-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
[AIRFLOW-3767] Correct bulk insert function #4773
[AIRFLOW-3767] Correct bulk insert function #4773
Conversation
8b50dc7
to
ed239f5
Compare
Codecov Report
@@ Coverage Diff @@
## master #4773 +/- ##
=========================================
+ Coverage 74.33% 74.44% +0.1%
=========================================
Files 450 450
Lines 28970 28972 +2
=========================================
+ Hits 21536 21569 +33
+ Misses 7434 7403 -31
Continue to review full report at Codecov.
|
airflow/hooks/oracle_hook.py
Outdated
values = ', '.join(':%s' % i for i in range(1, len(target_fields) + 1)) | ||
prepared_stm = 'insert into {tablename} ({columns}) values ({values})'.format( | ||
if target_fields: | ||
columns = ', '.join(target_fields) |
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.
Maybe move this directly inside of the format? or give it a different name, I don't like overwriting variables :-)
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.
@Fokko Change the code as you said, waiting for CI pass, PTAL.
Fix Oracle hook bulk_insert bug when param target_fields is None or rows is empty iterable
efc1141
to
125b411
Compare
CI test failed many many many time for no detaile resone 😭 😭 😭 |
125b411
to
0a3f460
Compare
CI pass finally |
The CI is currently super flaky 😭 |
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.
LGTM, thanks @zhongjiajie
Thanks @Fokko |
* [AIRFLOW-3767] Correct bulk insert function Fix Oracle hook bulk_insert bug when param target_fields is None or rows is empty iterable * change without overwriting variables as Fokko said
* [AIRFLOW-3767] Correct bulk insert function Fix Oracle hook bulk_insert bug when param target_fields is None or rows is empty iterable * change without overwriting variables as Fokko said
* [AIRFLOW-3767] Correct bulk insert function Fix Oracle hook bulk_insert bug when param target_fields is None or rows is empty iterable * change without overwriting variables as Fokko said
Fix Oracle hook bulk_insert bug when
target_fields
is None orrows
isempty iterable
Make sure you have checked all steps below.
Jira
Description
Fix Oracle_hook bulk_insert_rows while param
target_fields
is None androws
is empty iterable.Tests
test/hooks/test_oracle_hook.py
functiontest_bulk_insert_rows_without_fields
andtest_bulk_insert_rows_no_rows
Commits
Documentation
Code Quality
flake8