-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Fix bugs in URI constructor for MySQL connection #24320
Conversation
You do realize that "model/connection" is used by more than MySQL? Are you sure you are not breaking other usages? It seems it does break a lot of tests at least. I'd be really cautious to modify "airflow core" connection method to fix MySQL.. This looks (without going into details) like a need to override the method in MySQL connection to do mysql-specific stuff rather than change behaaviours of all other connections. |
I am not saying it's wrong - but just - that - be cautions and try to understand how this "shared" method is used elsewhere before attempting to change it. |
38e9065
to
2f89d6a
Compare
@potiuk I think my change in In last commit I have moved unit tests from |
Could you please point me to the docs/specs where FWIW the URI specification https://datatracker.ietf.org/doc/html/rfc3986#section-3.3 is quite clear that the According to the RFC - Can you trace down where the limitation of "require |
@potiuk yes of course in sqlalchemy doc https://docs.sqlalchemy.org/en/14/core/engines.html#database-urls has link to RFC-1738 spec. This spec in point 3.3 has this string |
@potiuk yes of course in sqlalchemy doc https://docs.sqlalchemy.org/en/14/core/engines.html#database-urls has link to RFC-1738 spec. This spec in point 3.3 has this string If neither nor is present, the "/" may also be omitted.. For me this string means that we should omitt / only in case when we don't have both of parameters and if we have one of them the / should be. Correct me please if I make mistake? Ah OK. Thanks for pointing it out. Indeed '/' was obligatory in 1738. SQL alchemy follow the older URL RFC (1738) which has actually been deprecated by URI (3986) - even though URI would be more approprite :D :
|
It's ok but we should change the title (as it is not MySQL -specific any more - but we can fix it at merge) and since it touches the core, I will need another approval (@uranusjr maybe?). |
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. |
* Fix bugs in URI constructor for MySQL connection * Update unit tests (cherry picked from commit ea54faf)
* Fix bugs in URI constructor for MySQL connection * Update unit tests (cherry picked from commit ea54faf)
In this PR I have fixed several bugs in the
get_uri
function in connection.py file. And also I have created unit tests for most of the use cases for this function.Co-authored-by: Maksim Yermakou maksimy@google.com
Co-authored-by: Wojciech Januszek januszek@google.com
Co-authored-by: Lukasz Wyszomirski wyszomirski@google.com
^ 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 a newsfragement file, named
{pr_number}.significant.rst
, in newsfragments.