You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/02/11 16:21:14 UTC

[GitHub] [airflow] kaxil commented on pull request #14193: Adding `pretty-py3` library to get it's features

kaxil commented on pull request #14193:
URL: https://github.com/apache/airflow/pull/14193#issuecomment-777615243


   > > Simply adding this library won't change anything.
   > > We already use [willmcgugan/rich](https://github.com/willmcgugan/rich) which you can leverage to have similar functionality
   > 
   > I've tested it locally and it fixes the issue if the library is importable from Jinja...
   > I'm not sure I understand you correctly... Airflow is using Jinja in this case in this line and Jinja uses `pretty`... Could you please explain how that lib you provided should fix my issue?
   
   
   
   The library `pretty-py3` is not actively maintained and I am not sure if we should use it that globally.
   
   Jinja uses built-in library not an external library - 
   https://github.com/pallets/jinja/blob/f009a004a2e70a3608d49aceb1814b90bb4370d6/src/jinja2/utils.py#L160
   
   https://docs.python.org/3.8/library/pprint.html
   
   That said -- I think the users who want it can use the library you mentioned or add their own custom filter.
   
   You can just do `{{ yourvar| custom_pprint}}` where `custom_pprint` is your custom filter and Jinja will print it nicely I think: https://stackoverflow.com/a/25728848/5691525


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org