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

Allow custom SQL query for GBQTableDataSet #1032

Closed
simonpicard opened this issue Nov 12, 2021 · 3 comments
Closed

Allow custom SQL query for GBQTableDataSet #1032

simonpicard opened this issue Nov 12, 2021 · 3 comments
Labels
Issue: Feature Request New feature or improvement to existing feature

Comments

@simonpicard
Copy link
Contributor

Description

Similar to SQLTableDataSet and SQLQueryDataSet, I would like to have a GBQQueryDataSet where I can specify to query to run on GBQ.

Context

I am building a data pipeline where I increment data every day in GBQ tables, therefore I need to be able to select a portion of the data which has not been processed yet.

Possible Implementation

Create a new class inheriting from GBQTableDataSet with an extra arg sql.
sqlis then passed to pd.read_gbq as is in the _loadfunction.
I actually implemented it that way as a custom dataset for my project.

Possible Alternatives

n/a

Thanks for reading!

@simonpicard simonpicard added the Issue: Feature Request New feature or improvement to existing feature label Nov 12, 2021
@datajoely
Copy link
Contributor

Hi @simonpicard thanks for raising the issue - makes sense and I'll add it to the backlog.

If you need it quickly the best thing to do is to implement it yourself by inheriting the existing class and customising it for your own purposes. There are some instructions on how to do this here.

If you do manage to implement this we would really appreciate a PR if you have the time? In theory it should match the pandas.SQLQueryDataSet implementation + the nifty recent contribution to point to a *.sql file.

@lorenabalan
Copy link
Contributor

Closing this as resolved in #1039

@lorenabalan
Copy link
Contributor

Thank you @simonpicard!!

Galileo-Galilei pushed a commit to Galileo-Galilei/kedro that referenced this issue Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Feature Request New feature or improvement to existing feature
Projects
None yet
Development

No branches or pull requests

3 participants