diff --git a/nwb_linkml/src/nwb_linkml/includes/hdmf.py b/nwb_linkml/src/nwb_linkml/includes/hdmf.py index df73d68..3d456d0 100644 --- a/nwb_linkml/src/nwb_linkml/includes/hdmf.py +++ b/nwb_linkml/src/nwb_linkml/includes/hdmf.py @@ -386,7 +386,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py index 072d163..6e9755e 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py @@ -677,7 +677,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py index 6093ac5..416c28c 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py @@ -677,7 +677,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py index 5905a23..aff7d58 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py @@ -677,7 +677,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py index 0bb0467..96a4328 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_0/hdmf_common_table.py @@ -679,7 +679,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py index 122d3d3..52d057e 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_2_1/hdmf_common_table.py @@ -679,7 +679,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py index 470c9e7..9a305bd 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_3_0/hdmf_common_table.py @@ -679,7 +679,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py index 7f094be..5ab6a67 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_4_0/hdmf_common_table.py @@ -679,7 +679,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py index e159c68..cce6b51 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py @@ -679,7 +679,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py index e348fae..08b3530 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_5_1/hdmf_common_table.py @@ -679,7 +679,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py index bb7a801..ce357b4 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_6_0/hdmf_common_table.py @@ -679,7 +679,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py index 50d610a..d94c2b7 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_7_0/hdmf_common_table.py @@ -679,7 +679,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column diff --git a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py index d477089..f47733e 100644 --- a/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py +++ b/nwb_models/src/nwb_models/models/pydantic/hdmf_common/v1_8_0/hdmf_common_table.py @@ -679,7 +679,7 @@ class DynamicTableMixin(ConfiguredBaseModel): return handler(val) except ValidationError as e: annotation = cls.model_fields[info.field_name].annotation - if type(annotation).__name__ == "_UnionGenericAlias": + while hasattr(annotation, "__args__"): annotation = annotation.__args__[0] try: # should pass if we're supposed to be a VectorData column