Skip to content

Commit

Permalink
Fix failing checker AGAIN: property type checker when the type is a c…
Browse files Browse the repository at this point in the history
…lass.
  • Loading branch information
jrobinAV committed Jan 30, 2025
1 parent 81390f8 commit 65828fc
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions taipy/core/config/checkers/_data_node_config_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,22 @@ def _check_property_types(self, data_node_config_id: str, data_node_config: Data
prop_value = data_node_config.properties.get(prop_key) if data_node_config.properties else None

if prop_value:
if isclass(prop_type) and isclass(prop_value) and not issubclass(prop_value, prop_type):
self._error(
prop_key,
prop_value,
f"`{prop_key}` of DataNodeConfig `{data_node_config_id}` must be"
f" populated with a subclass of {prop_type}.",
)
if not isinstance(prop_value, prop_type):
if isclass(prop_type) and isclass(prop_value):
if not issubclass(prop_value, prop_type):
self._error(
prop_key,
prop_value,
f"`{prop_key}` of DataNodeConfig `{data_node_config_id}` must be"
f" populated with a subclass of {prop_type}.",
)
elif not isinstance(prop_value, prop_type):
self._error(
prop_key,
prop_value,
f"`{prop_key}` of DataNodeConfig `{data_node_config_id}` must be"
f" populated with a {prop_type}.",
)
if prop_type == Callable and callable(prop_value) and prop_value.__name__ == "<lambda>":
elif prop_type == Callable and callable(prop_value) and prop_value.__name__ == "<lambda>":
self._error(
prop_key,
prop_value,
Expand Down

0 comments on commit 65828fc

Please sign in to comment.