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/07/23 06:33:10 UTC

[GitHub] [airflow] mehmax commented on issue #17032: Improved SQL rendering within BigQueryInsertJobOperator

mehmax commented on issue #17032:
URL: https://github.com/apache/airflow/issues/17032#issuecomment-885431431


   Hi all, jut joining the conversation from another discussion. 
   How about updating views.py so that it will show dicts and lists not as a whole, but with individual items:
   
   Proof of concept:
   views.py:
   -> in this example, empty dicts and lists are not rendered
   ```
               if renderer in renderers:
                   if isinstance(content, dict):
                       for key, value in content.items():
                           html_dict['.'.join([template_field, key])] = renderers[renderer](value)
                   elif isinstance(content, list):
                       for index, value in enumerate(content):
                           html_dict['.'.join([template_field, index])] = renderers[renderer](content)
                   else:
                       html_dict[template_field] = renderers[renderer](content)
   ```
   
   this is the screenshot from before:
   ![image](https://user-images.githubusercontent.com/84371809/126745292-ade0e36e-60a2-4d8a-99e9-927483e52726.png)
   
   
   after coding change:
   
   ![image](https://user-images.githubusercontent.com/84371809/126744743-7e90e124-93b6-41c6-8556-45cff30b36b3.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: commits-unsubscribe@airflow.apache.org

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