diff --git a/taipy/core/config/checkers/_data_node_config_checker.py b/taipy/core/config/checkers/_data_node_config_checker.py index 522e5ca7f..b9a3652e6 100644 --- a/taipy/core/config/checkers/_data_node_config_checker.py +++ b/taipy/core/config/checkers/_data_node_config_checker.py @@ -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__ == "": + elif prop_type == Callable and callable(prop_value) and prop_value.__name__ == "": self._error( prop_key, prop_value,