-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
[Oracle] Add port to DSN #15589
[Oracle] Add port to DSN #15589
Conversation
Could you please add a unit test for that ? |
@potiuk done – and I have fixed a minor bug (it shouldn't add the port suffix if it's the default port). |
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'd probably removed the 1521 check (or change it to check for None
instead); even if the port is the default, there's no harm including it in the DSN.
@uranusjr it seems to me that if conn.schema is not None:
dsn += "/" + conn.schema E.g. That seems to be right based on my experiments in passing in such a connection string. |
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.
Indeed looks like at least service_name should be added as well:
@potiuk yes, but when you're just providing a connection string, So if we want |
Hmm. I think this is not how (at least originally) the oracle connection was designed so far - it never mentions schema in the docs and it makes a clear distinction between SID (seems older system) and Service_name - seems like a newer one. The docs https://airflow.apache.org/docs/apache-airflow-providers-oracle/stable/connections/oracle.html are slightly misleading I think (They do not mention that service_name is passed as service_name extra. However I think I am perfectly fine with using schema as service_name in case the latter is not present. That makes sense and makes it consistent with other DBAPIHooks (for example MySQL https://airflow.apache.org/docs/apache-airflow-providers-mysql/stable/connections/mysql.html) . Would you mind also updating the docs for it ? And yeah. That would indeed be nicer URL in many cases:
rather than
But for backwards compatibility we should support both |
@potiuk I have cleaned up the docs and code to emphasize that Host and Schema (and the rest of the standard fields) are perfectly good for most users. If a user has an Oracle DSN (Data Source Name) then they can leave Host empty and use the |
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.
Love it!
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest master or amend the last commit of the PR, and push it with --force-with-lease. |
@potiuk so this still needs two additional reviews is that how the process works? |
No. I t just needs fixes of the failing tests (just make sure to rebase it to latest master and make sure all the checks are green) |
44fedf1
to
5db34f5
Compare
@potiuk I think the test failure is unrelated. I noticed this in the test log:
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
These test failures seem unrelated to this PR. |
Yeah. Can you please rebase on top of the latest master? There were a couple of problems in master that have been just fixed. |
6792819
to
3597a74
Compare
@potiuk done! |
@potiuk fixed – thanks for the patience! (I had a missing newline in the rst markup.) |
@potiuk fixed whitespace – using |
Actually having |
Awesome work, congrats on your first merged pull request! |
This adds the port (if specified) to the DSN string.
Previously, a port would be ignored.
^ 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.