Skip to content

Commit 2f7d6d6

Browse files
committed
using get to check if the data present in dict
1 parent 6353c82 commit 2f7d6d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/hsfs/hopsworks_udf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ def from_response_json(
657657
dropped_feature.strip()
658658
for dropped_feature in json_decamelized["dropped_argument_names"]
659659
]
660-
if "dropped_argument_names" in json_decamelized
660+
if json_decamelized.get("dropped_argument_names", None)
661661
else None
662662
)
663663
transformation_function_argument_names = (
@@ -667,15 +667,15 @@ def from_response_json(
667667
"transformation_function_argument_names"
668668
]
669669
]
670-
if "transformation_function_argument_names" in json_decamelized
670+
if json_decamelized.get("transformation_function_argument_names", None)
671671
else None
672672
)
673673
statistics_features = (
674674
[
675675
feature.strip()
676676
for feature in json_decamelized["statistics_argument_names"]
677677
]
678-
if "statistics_argument_names" in json_decamelized
678+
if json_decamelized.get("statistics_argument_names", None)
679679
else None
680680
)
681681

0 commit comments

Comments
 (0)