-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Feature add get polars df to dbapihook and bigqueryhook #34679
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
Closed
bfeif
wants to merge
3
commits into
apache:main
from
bfeif:feature-add-get-polars-df-to-dbapihook-and-bigqueryhook
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm not sure how for
polaris, but forpandasthe same method is broken. Let me explain:get_sqlalchemy_engineis also broken in some cases becauseget_urlis broken, see discussion in dev list: https://lists.apache.org/thread/8rhmz3qh30hvkondct4sfmgk4vd07mn5There 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 it is not a case for
polarisI'm not familiar with this libThere 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.
In the issue it was suggested to have
get_df(generic function) that accept as parameter if it should be pandas/polars - why did you choose not to have it eventually?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 was suggest that we should not merge something in single implementation especially if no one know how
pandasandpolarisinterface compatible. I just worried that if we merge it now, than it could turned into the something like BackfillJobRunner._backfill_job_runner.py which literally have 170 different statements.And in additional pandas is broken for at least half implementations: #34679 (comment), so my vision that we should fix it first before we could create some generic method
Uh oh!
There was an error while loading. Please reload this page.
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.
@Taragolis the
polarsdoc onread_database()states the following:... and the
connectionobject eventually gets passed in the constructor to thepolarsConnectionExecutorhere. Does this answer your question?Uh oh!
There was an error while loading. Please reload this page.
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.
@eladkal you are right (link to suggestion in issue), this was suggested.
I made this decision because the APIs of
polarsandpandasare quite syntactically different for the actual querying, so theget_dfgeneric function would have just been a big switch statement, which seemed to me to add no value (this syntactic difference is larger on theBigQueryHookthan on theDbApiHook, I do admit).Furthermore, I'm not sure why we'd want to add
get_dfwithout also removing (or at least removing exposure of) the underlying methodsget_polars_dfandget_pandas_df; havingget_df,get_polars_df, andget_pandas. Doing this removal, however, would be a breaking change for a lot of users' code.It seemed to me like such a
get_dfredefinition may fall better under the scope of a refactoring ticket.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.
We don't have to remove anything. We can deprecate and raise deprecation warning.
For such deprecation we probably will give very long time before actually removing it
Uh oh!
There was an error while loading. Please reload this page.
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.
It still seems to me to be over-engineering, at least for now @eladkal.