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

Delete tables #1916

Merged
merged 3 commits into from
Sep 30, 2021
Merged

Delete tables #1916

merged 3 commits into from
Sep 30, 2021

Conversation

felixwang9817
Copy link
Collaborator

What this PR does / why we need it: Currently, entity dataframes are uploaded to Bigquery and Redshift and are not always cleaned up properly. This PR ensures they are always cleaned up.

Which issue(s) this PR fixes:

Fixes #1902

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Felix Wang <wangfelix98@gmail.com>
Signed-off-by: Felix Wang <wangfelix98@gmail.com>

def to_sql(self) -> str:
"""
Returns the SQL query that will be executed in BigQuery to build the historical feature table.
"""
return self.query
with self._query_generator() as query:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: technically the query generated here will not be the exact query used to build the historical feature table, since the randomly generated table name will be different. I couldn't think of a better way to handle to_sql given that we switched to a context manager - open to suggestions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm in that case we run think we should either return a sql strinv with the table name a parameter that canbe filled the, or we should accept it as a param forthr to_sql method. As it stands a full SQL string that does is not expected to execute correctly seems like a bug

@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2021

Codecov Report

Merging #1916 (4fa80bb) into master (5d0f37b) will decrease coverage by 0.60%.
The diff coverage is 60.86%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1916      +/-   ##
==========================================
- Coverage   82.95%   82.35%   -0.61%     
==========================================
  Files          96       96              
  Lines        7359     7454      +95     
==========================================
+ Hits         6105     6139      +34     
- Misses       1254     1315      +61     
Flag Coverage Δ
integrationtests 74.41% <60.86%> (+0.03%) ⬆️
unittests 60.64% <4.34%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdk/python/feast/infra/offline_stores/bigquery.py 80.00% <58.13%> (+0.73%) ⬆️
sdk/python/feast/infra/offline_stores/redshift.py 85.00% <100.00%> (+0.12%) ⬆️
sdk/python/feast/infra/utils/aws_utils.py 58.94% <0.00%> (-24.09%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d0f37b...4fa80bb. Read the comment docs.

Signed-off-by: Felix Wang <wangfelix98@gmail.com>
Copy link
Member

@achals achals left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: achals, felixwang9817

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:
  • OWNERS [achals,felixwang9817]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@feast-ci-bot feast-ci-bot merged commit 03c8317 into feast-dev:master Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up entity dataframes or temporary tables by default
4 participants