dimonchik-suvorov opened a new issue #14192:
URL: https://github.com/apache/airflow/issues/14192


   The case is when Airflow preparing a `Rendered Template` view it uses Jinja 
and Jinja uses a simple `pprint` which returns an ugly result surrounded by 
redundant single/double quotes in case it can't found and import `pretty` 
module.
   
   <details>
   <summary>Example of how it could be displayed</summary>
   <p>
   
   ```
   ('USE test_db;\n'
   '\n'
   'INSERT OVERWRITE TABLE \n'
   ' test_table\n'
   "PARTITION (part_column = 'some_part_value')\n"
   '\n'
   'SELECT  \n'
   ' field1           AS f_1,\n'
   ' count(*)         AS cnt\n'
   'FROM\n'
   ' source_table\n'
   'WHERE\n'
   " part_column = 'some_part_value';")
   ```
   </p>
   </details>  
   
   The line of Airflow code where it uses Jinja formatting - 
[views.py#L916](https://github.com/apache/airflow/blob/master/airflow/www/views.py#L916)
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to