Skip to content
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

Suppress JException when get_autocommit and set_autocommit methods aren't supported on JDBC driver #43786

Conversation

dabla
Copy link
Contributor

@dabla dabla commented Nov 7, 2024

Today we experienced that when the get_autocommit or the set_autocommit methods aren't supported on the SAS Jdbc driver,
we get an jpype.JException instead of an jaydebeapi.Error, so I added it to the suppressed exceptions. Unfortunately, I wasn't able to add a specific test case for that exception, as I was unable to mock the JException without the need of a JVM running, which we don't want.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

…eptions if those operations aren't supported by the JDBC driver
@dabla dabla marked this pull request as draft November 8, 2024 11:44
@dabla dabla marked this pull request as ready for review November 8, 2024 11:59
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with small nit about version update

@eladkal eladkal changed the title Also suppress JException when get_autocommit and set_autocommit methods aren't supported on Jdbc driver Suppress JException when get_autocommit and set_autocommit methods aren't supported on JDBC driver Nov 12, 2024
@potiuk potiuk merged commit b32ca97 into apache:main Nov 28, 2024
62 checks passed
prabhusneha pushed a commit to astronomer/airflow that referenced this pull request Nov 28, 2024
…en't supported on JDBC driver (apache#43786)

* refactor: get_autocommit and set_autocommit should also suppress JExceptions if those operations aren't supported by the JDBC driver

* refactor: Use the cached connection property instead of get_connection in sqlalchemy_url and get_conn methods

* refactor: Bumped version of jdbc provider to 4.5.3

* Update providers/src/airflow/providers/jdbc/provider.yaml

---------

Co-authored-by: David Blain <david.blain@infrabel.be>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
LefterisXefteris pushed a commit to LefterisXefteris/airflow that referenced this pull request Jan 5, 2025
…en't supported on JDBC driver (apache#43786)

* refactor: get_autocommit and set_autocommit should also suppress JExceptions if those operations aren't supported by the JDBC driver

* refactor: Use the cached connection property instead of get_connection in sqlalchemy_url and get_conn methods

* refactor: Bumped version of jdbc provider to 4.5.3

* Update providers/src/airflow/providers/jdbc/provider.yaml

---------

Co-authored-by: David Blain <david.blain@infrabel.be>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants