peloyeje commented on PR #22854:
URL: https://github.com/apache/airflow/pull/22854#issuecomment-1133602903

   Yep sure!
   While doing so I notice I introduced a rendering bug when attempting to 
render a "py-templated" task attribute containing a list with non-string 
elements (python lexer fails because it tries to access `.decode` on the 
elements). 
   
   So I dug a bit more and I have a question about the whole 
`get_python_source` logic of the airflow.www.utils.render function. AFAIU the 
`rendered-templates` view fetches task rendered templates from the DB with 
`ti.get_rendered_template_fields()` which uses logic from 
`RenderedTaskInstanceFields`. As the latter stringifies any template field 
value that is not JSON serializable, it means - if I get this right - that as 
soon as a templated field value contains a class (as such or as a list/dict 
element), this vlaue is treated as a string ... So I wonder in what cases does 
this `get_python_source` method can be called: would tweaking the 
`serialize_template_field` helper used in `RenderedTaskInstanceFields` to 
support callable (like this: 
https://github.com/apache/airflow/blob/cc3ab432e32485e491d81c180ec807b275a0cafa/airflow/serialization/serialized_objects.py#L355)
 be a good idea?
   
   Many thanks for your guidance!


-- 
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