ephraimbuddy commented on code in PR #38094:
URL: https://github.com/apache/airflow/pull/38094#discussion_r1537127130
##########
airflow/serialization/helpers.py:
##########
@@ -38,7 +40,21 @@ def is_jsonable(x):
else:
return True
+ max_length = conf.getint("core", "max_templated_field_length")
+
if not is_jsonable(template_field):
+ if len(str(template_field)) > max_length:
+ rendered = redact(str(template_field), name)
+ return (
+ "Truncated. You can change this behaviour in
[core]max_templated_field_length. "
+ f"{rendered[:max_length - 79]!r}... "
+ )
return str(template_field)
else:
+ if template_field and len(str(template_field)) > max_length:
+ rendered = redact(str(template_field), name)
Review Comment:
Using json.dumps brought up some extra quotes. Reduced str usage
--
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]