-
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
Merged
feast-ci-bot
merged 7 commits into
feast-dev:master
from
Shopify:vt/to_bigquery_function
Jun 16, 2021
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4cb2f01
Add to_bigquery() function for bq retrieval job
vtao2 e49ce8f
Using tenacity for retries
vtao2 c45765c
Refactoring to_biquery function
vtao2 5e5d470
Adding tenacity dependency and changing temp table prefix to historical
vtao2 d7717ef
Use self.client instead of creating a new client
vtao2 0ef414d
pin tenacity to major version
vtao2 d2090f2
Tenacity dependency range
vtao2 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -441,6 +441,22 @@ 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) | ||
assert bq_dry_run is None | ||
|
||
bq_temp_table_path = job_from_sql.to_bigquery() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you as a test with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
assert bq_temp_table_path.split(".")[0] == gcp_project | ||
|
||
if provider_type == "gcp_custom_offline_config": | ||
assert bq_temp_table_path.split(".")[1] == "foo" | ||
else: | ||
assert bq_temp_table_path.split(".")[1] == bigquery_dataset | ||
|
||
# Check that this table actually exists | ||
actual_bq_temp_table = bigquery.Client().get_table(bq_temp_table_path) | ||
assert actual_bq_temp_table.table_id == bq_temp_table_path.split(".")[-1] | ||
|
||
start_time = datetime.utcnow() | ||
actual_df_from_sql_entities = job_from_sql.to_df() | ||
end_time = datetime.utcnow() | ||
|
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.
The following would be cleaner
Indeed, there is no need to return
path
when you use thedry_run
option as the destination table has not been createdThere 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.
sounds good, changed