-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved UI rendering of templated dicts and lists #17239
Conversation
This will not add any line breaks. Especially when handling templated files (e.g. sql) line breaks will make the display more beautiful. UI will now render each key+value from dicts and each index+value from lists seperately as own lines. e.g configurations { "key1" : "value1" "key2" : "value2" } will be shown as configurations.key1 value1 configurations.key2 value2
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
Changed this to a draft, because I noticed that this can be improve this a little, so that |
Looks good already :) @nathadfield ? And yeah - automated |
Rather than |
… pythonic way with brackets [0]
Hi @nathadfield @potiuk I am quite new to contributing. Would you mind taking a look at this and give me some feedback? :) My approach is a bit different to yours @nathadfield. I wanted to expand every dict / list by default. If list or dict item is listed in Thank you guys! |
@mehmax I am by no means a seasoned contributor either! I did try to accommodate the expanding and rendering of 'op_kwargs` in my PR #17321 which I don't know if you've looked at it. We definitely have similar and overlapping interests here so I'd be keen to hear from others about what we've both done and how we can bring them together. For example, I could scale back the scope of mine so that it only focuses on delivering dictionary path rendering to operators. |
done! |
I guess we can close it as #17321 has been merged. |
UI displayed rendered template dicts and lists as a json.dump.
This will not add any line breaks.
Especially when handling templated files (e.g. sql) line breaks will make the display more beautiful.
UI will now render each key+value from dicts and each index+value from lists seperately as own lines.
Example
Dictionaries
Old
New
Lists
Old
New
Nested dicts/lists
Old
New
Mixed
Old
New
It is now also possible to specify a dictionary or list path in
template_field_renderers
.e.g.
{'configurations.sql' : 'sql' }
or
{'configurations[0] : 'sql'}
even nested dict/list paths are possible
{'configurations[0].sql : 'sql'}
closes: #17032
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.