Correctly handle multiple '=' in LocalFileSystem secrets.#21694
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/main/CONTRIBUTING.rst)
|
0564950 to
6a9f1e3
Compare
|
Can you add tests to avoid regression? |
Sure |
|
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
1f1d7d1 to
1ac080a
Compare
5fe5eed to
5aea091
Compare
dbd49c3 to
63b657c
Compare
63b657c to
50f8a62
Compare
50f8a62 to
82010d0
Compare
|
Awesome work, congrats on your first merged pull request! |
(cherry picked from commit 919b75b)
(cherry picked from commit 919b75b)
(cherry picked from commit 919b75b)
(cherry picked from commit 919b75b)
(cherry picked from commit 919b75b)
(cherry picked from commit 919b75b)
(cherry picked from commit 919b75b)
(cherry picked from commit 919b75b)
Related issue: #21625
If there is another '=' in the conn string in the env file, it will been splited into 3 sub-string which is not expected( We expect it only been splited into 2 sub-string, key and value ).
For example,
MY_CONN_ID=my-conn-type://my-login:my-pa%2Fssword@my-host:5432/my-schema?param1=val1¶m2=val2it will been splited into:
['MY_CONN_ID', 'my-conn-type://my-login:my-pa%2Fssword@my-host:5432/my-schema?param1', 'val1¶m2=val2']and it will cause
ValueError: too many values to unpack (expected 2)laster at line 87 .key, value = var_partsIt can been fixed by
correct the maxsplit to 1 of line splituse partition instead in _parse_env_file function in LocalFileSystem secrets.Python docs: https://docs.python.org/3.11/library/stdtypes.html?#str.split
^ 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.