uranusjr commented on code in PR #27887:
URL: https://github.com/apache/airflow/pull/27887#discussion_r1031925774


##########
airflow/utils/json.py:
##########
@@ -189,7 +189,7 @@ def __init__(self, *args, **kwargs) -> None:
         if not kwargs.get("object_hook"):
             kwargs["object_hook"] = self.object_hook
 
-        patterns = conf.getjson("core", "allowed_deserialization_classes")
+        patterns = cast(list, conf.getjson("core", 
"allowed_deserialization_classes"))

Review Comment:
   This would result in a confusing error if the value is not set to a list. 
It’s probably better to explicitly check the value is a list instead (and raise 
a clear message explaining the config value is exact source of failure).



##########
airflow/utils/json.py:
##########
@@ -189,7 +189,7 @@ def __init__(self, *args, **kwargs) -> None:
         if not kwargs.get("object_hook"):
             kwargs["object_hook"] = self.object_hook
 
-        patterns = conf.getjson("core", "allowed_deserialization_classes")
+        patterns = cast(list, conf.getjson("core", 
"allowed_deserialization_classes"))

Review Comment:
   This would result in a confusing error if the value is not set to a list. 
It’s probably better to explicitly check the value is a list instead (and raise 
a clear message explaining the config value is the exact source of failure).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to