amoghrajesh commented on code in PR #48648:
URL: https://github.com/apache/airflow/pull/48648#discussion_r2029767260
##########
airflow-core/src/airflow/serialization/helpers.py:
##########
@@ -36,11 +36,6 @@ def serialize_template_field(template_field: Any, name: str)
-> str | dict | lis
def is_jsonable(x):
try:
json.dumps(x)
- if isinstance(x, tuple):
- # Tuple is converted to list in json.dumps
- # so while it is jsonable, it changes the type which might be
a surprise
- # for the user, so instead we return False here -- which will
convert it to string
- return False
Review Comment:
Falling back to the older behaviour as 2.x.
We will not do anything specical here.
##########
airflow-core/src/airflow/serialization/helpers.py:
##########
@@ -71,7 +66,9 @@ def translate_tuples_to_lists(obj: Any):
)
return serialized
else:
- if not template_field:
+ if not template_field and not isinstance(template_field, tuple):
+ # Avoid unnecessary serialization steps for empty fields unless
they are tuples
+ # and need to be converted to lists
Review Comment:
Yeah sounds OK for now
--
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]