-
Notifications
You must be signed in to change notification settings - Fork 16.3k
YAML file format in LocalFilesystemBackend #9477
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
Conversation
|
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/master/CONTRIBUTING.rst)
|
|
Can you also update docs? |
|
|
||
| .. code-block:: yaml | ||
| CONN_A: 'mysq://host_a' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use these examples in tests? This will facilitate verification that everything is okay.
| ( | ||
| ({}, {}), | ||
| ({"KEY": "AAA"}, {"KEY": "AAA"}), | ||
| ({"KEY_A": "AAA", "KEY_B": "BBB"}, {"KEY_A": "AAA", "KEY_B": "BBB"}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use YAML file here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added YAML files for both variables and connection tests
airflow/secrets/local_filesystem.py
Outdated
| return {}, [FileSyntaxError(line_no=1, message="The file is empty.")] | ||
| try: | ||
| secrets = yaml.safe_load(content) | ||
| except yaml.YAMLError as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| except yaml.YAMLError as e: | |
| except yaml.MarkedYAMLError as e: | |
| return {}, [FileSyntaxError(line_no=e.context_mark.line, message=str(e))] | |
| except yaml.YAMLError as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
mik-laj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this change. Editing JSON files was tiring.
|
Is this still a WIP? Should I go further? |
Nope not a WIP. Ill update the title. Please you can go further |
|
Awesome work, congrats on your first merged pull request! |
|
@VinayGb665 Thank you very much. What next? 🐈 |
|
Looking forward to contribute more. |
|
Could you add support for the extra parameter without using nested JSON? conn_c:
conn_type: scheme
host: host
extra_dejson:
extra__google_cloud_platform__keyfile_dict: AAACurrently, the extra parameter can only be defined as follows. conn_c:
conn_type: scheme
host: host
extra_dejson: {"extra__google_cloud_platform__keyfile_dict": "file_content"}It works, but it's not perfect. |
AAA being the file name? |
|
@VinayGb665 The content of the extra field depends on the implementation of the specific hook. For GCP, we have the following keys:
From a technical point of view, an extra is a JSON object with any keys and any values. |
|
@mik-laj If the intended YAML would look something like this then it should work fine with the current implementation itself |
|
Please create new PR :-) |
- Support towards YAML is added in PR apache#9477 Most docs were updated for this. But a few docstrings and exception logging were missed - Fix a minor error in the doc .rst file.
- Support towards YAML is added in PR #9477 Most docs were updated for this. But a few docstrings and exception logging were missed
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
- Support towards YAML is added in PR apache/airflow#9477 Most docs were updated for this. But a few docstrings and exception logging were missed GitOrigin-RevId: c6467ba12d4a94027137e3173097d73be56c5d12
Adding a yaml file parser to LocalFilesystemBackend, structure would be similar to that of earlier JSON found here and here
Closes : #9417
Make sure to mark the boxes below before creating PR: [x]
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.
Read the Pull Request Guidelines for more information.
@wip ready for review