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 2022/10/13 07:39:22 UTC

[GitHub] [airflow] dyon781 opened a new issue, #27026: Parameterise key sorting in "Rendered Template" view

dyon781 opened a new issue, #27026:
URL: https://github.com/apache/airflow/issues/27026

   ### Description
   
   Currently the https://github.com/apache/airflow/blob/main/airflow/www/views.py#L1254 has forceful sorting by keys. 
   It'd be very nice to have this behaviour parameterised and not hardcoded
   
   ### Use case/motivation
   
   Sometimes we have big templates with few nested levels and it's very inconvenient to see higher level keys scattered across few screens located at the very bottom of template despite initially it was on the very start just because it was sorted by key forcefully.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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

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


[GitHub] [airflow] uranusjr commented on issue #27026: Parameterise key sorting in "Rendered Template" view

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #27026:
URL: https://github.com/apache/airflow/issues/27026#issuecomment-1277302029

   What would you propose as the interface that controls this sorting logic?


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


[GitHub] [airflow] boring-cyborg[bot] commented on issue #27026: Parameterise key sorting in "Rendered Template" view

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #27026:
URL: https://github.com/apache/airflow/issues/27026#issuecomment-1277167978

   Thanks for opening your first issue here! Be sure to follow the issue template!
   


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


[GitHub] [airflow] uranusjr commented on issue #27026: Parameterise key sorting in "Rendered Template" view

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #27026:
URL: https://github.com/apache/airflow/issues/27026#issuecomment-1316340467

   Oh, so you mean per-operator sorting logic; I thought you were looking for custom sorting logic that each user can change independently in their own UI.
   
   The proposed structure feels overly complex to me, however.


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


[GitHub] [airflow] potiuk commented on issue #27026: Parameterise key sorting in "Rendered Template" view

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #27026:
URL: https://github.com/apache/airflow/issues/27026#issuecomment-1336258317

   I don't think it's a big issue. They can be "all sorted templated fields" first followed by all non-templated sorted by key. 
   
   That add additional info on which fields are templated . I think that might make most sense.


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


[GitHub] [airflow] dyon781 commented on issue #27026: Parameterise key sorting in "Rendered Template" view

Posted by GitBox <gi...@apache.org>.
dyon781 commented on issue #27026:
URL: https://github.com/apache/airflow/issues/27026#issuecomment-1277321798

   I've been thinking on three options to have it on custom operator level:
    Let's assume we have this set at custom operator:
       template_fields = ("field1", "field2",)
       template_fields_renderers = {"field1": "json"}
   
   1) We can have it redefined in whole for all:
       template_fields_kwargs = {"sort_keys": False}
   2) Or to have it on template column level:
       template_fields_kwargs = {"field1": {"sort_keys": False}}
   3) We can have it redefined on renderer level(this one is wild guess, it seems this is barely possible):
       template_fields_renderers_kwargs = {"json": {"sort_keys": False}}


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


[GitHub] [airflow] potiuk commented on issue #27026: Parameterise key sorting in "Rendered Template" view

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #27026:
URL: https://github.com/apache/airflow/issues/27026#issuecomment-1316958468

   Why not relying on sorting order in the templated_field tuple? You can always define your our custom operator with different sorting:
   
   ```
   class MyCustomOperator(OriginalOperator):
        template_fields = ('field2'. 'field1')
   ```
   
   Easy, starightforward, very easy to build a custom package with all the operators you want to have custom-sorted-fields for the whole installation, dag authors can override them as they want by adding their own custom operators for individual exceptins.
   
   I do not see the need for adding another field.
   


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


[GitHub] [airflow] uranusjr commented on issue #27026: Parameterise key sorting in "Rendered Template" view

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #27026:
URL: https://github.com/apache/airflow/issues/27026#issuecomment-1326964845

   Problem is `template_fields` does not contain all operator fields, and you’d have no way to sort those non-templated fields (especially if some of them can’t be templated to begin with).


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


[GitHub] [airflow] uranusjr commented on issue #27026: Parameterise key sorting in "Rendered Template" view

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #27026:
URL: https://github.com/apache/airflow/issues/27026#issuecomment-1342244238

   This can probably be discussed more easily if there’s a pull request demostrating what’s _intended_ and we can discuss the edge cases (if any).


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


[GitHub] [airflow] potiuk commented on issue #27026: Parameterise key sorting in "Rendered Template" view

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #27026:
URL: https://github.com/apache/airflow/issues/27026#issuecomment-1336258404

   WDYT @uranusjr ?


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