-
Notifications
You must be signed in to change notification settings - Fork 43
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
Raise error if dataframe is empty #1238
Conversation
Codecov ReportBase: 94.13% // Head: 94.80% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1238 +/- ##
==========================================
+ Coverage 94.13% 94.80% +0.66%
==========================================
Files 17 69 +52
Lines 597 3235 +2638
Branches 67 378 +311
==========================================
+ Hits 562 3067 +2505
- Misses 22 104 +82
- Partials 13 64 +51
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
00efb01
to
0c7c47f
Compare
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.
Do we need to add this check for postgres
, redshift
and bigquery
too? Since we're overriding the load_pandas_dataframe_to_table
method in those implementations too?
71cd37d
to
6cce012
Compare
c7b93a3
to
c0dc515
Compare
In my opinion, we should not be creating tables as part of |
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 feel that we should have a separate method which should check if dataframe is empty in the base class. That method can be overridden for Postgres and Bigquery.
+1 on this. I feel we should not do multiple things as part of same method. |
14cb0ae
to
8b2b81c
Compare
for more information, see https://pre-commit.ci
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.
Shouldn't _assert_not_empty_df(df)
be overridden for PostGres and Bigquery like you had mentioned?
# Description closes: #810 ## What is the current behavior? In case of an empty dataframe the data frame operator throws an SQL syntax error. ## What is the new behavior? If the database does not support the creation of a table without a the column then raises an error ## Does this introduce a breaking change? No ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] Extended the README / documentation, if necessary (cherry picked from commit 0690ac6)
Description
closes: #810
What is the current behavior?
In case of an empty dataframe the data frame operator throws an SQL syntax error.
What is the new behavior?
If the dataframe is empty then raise an error
Does this introduce a breaking change?
No
Checklist