From 268d13ba55e923320bfbb039c58e02549a0a1540 Mon Sep 17 00:00:00 2001 From: elijahbenizzy Date: Tue, 24 Sep 2024 11:28:18 -0700 Subject: [PATCH] Fixes subclass check Any is a subclass of everything and visa versa. Need to figure out blast radius of this change (might want to be a parameter in the function). --- hamilton/htypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hamilton/htypes.py b/hamilton/htypes.py index e1db63a26..559fd8cbc 100644 --- a/hamilton/htypes.py +++ b/hamilton/htypes.py @@ -49,7 +49,7 @@ def custom_subclass_check(requested_type: Type, param_type: Type): param_type, _ = get_type_information(param_type) param_origin_type = param_type has_generic = False - if param_type == Any: + if param_type == Any or requested_type == Any: # any type is a valid subclass of Any. return True if _safe_subclass(requested_type, param_type):