-
Notifications
You must be signed in to change notification settings - Fork 998
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
Add to_bigquery()
function to BigQueryRetrievalJob
#1634
Add to_bigquery()
function to BigQueryRetrievalJob
#1634
Conversation
Hi @vtao2. Thanks for your PR. I'm waiting for a feast-dev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Could we add a parameter for dry run in the method? QueryJobConfig has a dry_run option |
Hi @mavysavydav , What would be the |
to_bigquery()
function to BigQueryRetrievalJob
8e58ec6
to
6508cf2
Compare
6508cf2
to
2f2a5e4
Compare
2f2a5e4
to
e5c80b1
Compare
e5c80b1
to
a5cccd4
Compare
a5cccd4
to
d6619e7
Compare
d6619e7
to
9eedfd1
Compare
8053848
to
5da2b78
Compare
/retest |
print( | ||
"This query will process {} bytes.".format(bq_job.total_bytes_processed) | ||
) | ||
return path |
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.
Should we just return nothing when we asked for a dry_run ? I don't understand the utility of the path
if the table never been created. What I am missing 🤔 ?
if dry_run:
return
...
return path
It just means that this function will output an Optional[str]
def to_bigquery(self, dry_run=False) -> Optional[str]:
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.
Good point :) changed :D
@@ -441,6 +441,23 @@ def test_historical_features_from_bigquery_sources( | |||
], | |||
) | |||
|
|||
# Just a dry run, should not create table | |||
bq_dry_run = job_from_sql.to_bigquery(dry_run=True) | |||
with pytest.raises(Exception): |
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 you have access to a more accurate exception like TableNotFound
?
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.
actually, since we won't return the path, can just test that nothing is returned when calling dry run :)
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.
changed it to reflect that
5da2b78
to
005e152
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.
LGTM
005e152
to
a883fe6
Compare
/retest |
a883fe6
to
6b63985
Compare
Codecov Report
@@ Coverage Diff @@
## master #1634 +/- ##
==========================================
+ Coverage 83.39% 83.54% +0.14%
==========================================
Files 71 71
Lines 6113 6173 +60
==========================================
+ Hits 5098 5157 +59
- Misses 1015 1016 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: Vivian Tao <vivian.tao@shopify.com>
6b63985
to
4cb2f01
Compare
@vtao2 Just a small nitpick, but I noticed we're deleting our commits and force pushing the same commit message. This makes it impossible to see the history of changes and also leads to broken links which makes reviews hard, for example https://github.com/feast-dev/feast/pull/1634/files/6b6398530c69f221629b837225be2870fde75263..4cb2f010de767e8d1aef827c0446a0b968baded9 |
Signed-off-by: Vivian Tao <vivian.tao@shopify.com>
Signed-off-by: Vivian Tao <vivian.tao@shopify.com>
Signed-off-by: Vivian Tao <vivian.tao@shopify.com>
Signed-off-by: Vivian Tao <vivian.tao@shopify.com>
Signed-off-by: Vivian Tao <vivian.tao@shopify.com>
Signed-off-by: Vivian Tao <vivian.tao@shopify.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MattDelac, vtao2, woop The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
* Add to_bigquery() function for bq retrieval job Signed-off-by: Vivian Tao <vivian.tao@shopify.com> * Using tenacity for retries Signed-off-by: Vivian Tao <vivian.tao@shopify.com> * Refactoring to_biquery function Signed-off-by: Vivian Tao <vivian.tao@shopify.com> * Adding tenacity dependency and changing temp table prefix to historical Signed-off-by: Vivian Tao <vivian.tao@shopify.com> * Use self.client instead of creating a new client Signed-off-by: Vivian Tao <vivian.tao@shopify.com> * pin tenacity to major version Signed-off-by: Vivian Tao <vivian.tao@shopify.com> * Tenacity dependency range Signed-off-by: Vivian Tao <vivian.tao@shopify.com>
What this PR does / why we need it:
This PR adds a
to_bigquery()
function to theBigQueryRetrievalJob
class so thatget_historical_features()
can scale. This way, instead of writing to a dataframe (resulting in aResponse too large to return
error), we can write to a temporary destination table in BigQuery.Without this,
get_historical_features()
does not scale. It is unable to return a large dataset (eg: ~5B rows) as this data is too big for dataframes.Which issue(s) this PR fixes:
Fixes #1637
Does this PR introduce a user-facing change?: