jordanjeremy commented on issue #16808:
URL: https://github.com/apache/airflow/issues/16808#issuecomment-876615292


   As mentioned previously, this is not specific to AWS operators.  This issue 
also happens with @task decorated (TaskFlow API) operators, where the op_kwargs 
is a dict and is setup to be rendered as py.
   
![image](https://user-images.githubusercontent.com/72943478/124964827-148a9d00-dfe7-11eb-9057-47f6b0142d33.png)
   
   Possible solution is to update the "get_python_source" in 
utils/code_utils.py to handle list and dict.  Possibly something like:
   ```
       if isinstance(x, list):
           return [str(v) for v in x]
   
       if isinstance(x, dict):
           return {k: str(v) for k, v in x.items()}
   ```
   The converting values to strings seems necessary in order to avoid errors 
when this is passed to the pygments lexer.
   
![image](https://user-images.githubusercontent.com/72943478/124964971-3dab2d80-dfe7-11eb-8f43-d1f4494fbfd5.png)


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