-
Notifications
You must be signed in to change notification settings - Fork 16.4k
[AIRFLOW-2597] Restore original dbapi.run() behavior #3490
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
|
I was misunderstanding what @imroc, I'm basically reverting your change, I don't see why it was not working for you before your change. Can you elaborate please? Thank you |
Codecov Report
@@ Coverage Diff @@
## master #3490 +/- ##
==========================================
+ Coverage 17.95% 77.16% +59.2%
==========================================
Files 203 203
Lines 15124 15123 -1
==========================================
+ Hits 2716 11669 +8953
+ Misses 12408 3454 -8954
Continue to review full report at Codecov.
|
|
I think we should be very careful on any backward incompatible change and document it in the updating.md with unit test if it is really needed. I am +1 on the revert. |
|
Hmm.. Weird why the CI passed for that PR then... But yes, I am reverting the change. @imroc Please elaborate your issue here. |
|
Oh ok 👍 @yrqls21 . @Fokko Can you please have a look if the failing K8s test is related or not? That's the only test that is failing on master now. |
|
@kaxil @yrqls21 I wrote a DAG before, including some data insertion operation of mysql like this: hook = MySqlHook(mysql_conn_id='mysql_default', schema='test')
hook.run(
'insert into some_table(some_field) values(%s)' % (some_value),
autocommit=True)After the task runs, data is not inserted, because it was not committed, But I set |
|
@imroc , I think typically you should run session.commit() after the sql execution to persist the result. Besides you change the dbapi interface which inherits by most of the dbapi hooks which not all the hooks have autocommit support. |
|
@imroc You are correct, the query won't be committed for MySqlHook.run() even autocommit is set to I shall do a quick PR to fix that. ETA tomorrow night. |
|
@yrqls21 nice |
Closes apache#3490 from yrqls21/kevin_yang_fix_ci
JIRA
Description
dbapi.run() right now commits only when autocommit is set to true or db does not support autocommit. Restoring behavior before this commit.
This is breaking CI now.
Tests
fixes tests/operators/operators.py:PostgresTest.test_postgres_to_postgres
Commits
Documentation
Code Quality
git diff upstream/master -u -- "*.py" | flake8 --diff