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

feat: Adding saved dataset capabilities for Postgres #3002

Merged
merged 0 commits into from
Aug 9, 2022
Merged

feat: Adding saved dataset capabilities for Postgres #3002

merged 0 commits into from
Aug 9, 2022

Conversation

AlexEijssen
Copy link
Contributor

Signed-off-by: alex.eijssen alex.eijssen@energyessentials.nl

What this PR does / why we need it:
This PR adds the possibility to save datasets in Postgres and register them in Feast. I also tried to move the Postgres code more in the direction of Redshift and Bigquery.

Which issue(s) this PR fixes:

Fixes #2995

DISCLAIMER:
If you register a dataset the UI breaks. This appears to be independent of Postgres, as issue #2996 describes the same issue I have, but then for Snowflake. I suspect the issue is in feast/ui/src/parsers/feastSavedDataset.ts that is too stringent/limited. And I'm working on a fix (wrapping up a PR) that ensures registering a dataset doesn't break the UI.

@AlexEijssen AlexEijssen changed the title Adding saved dataset capabilities for Postgres feat: Adding saved dataset capabilities for Postgres Aug 3, 2022
Copy link
Collaborator

@adchia adchia left a comment

Choose a reason for hiding this comment

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

I'm assuming that this fixes at least one test in https://github.com/feast-dev/feast/blob/master/Makefile#L112

Mind removing the excluded tests and running to make sure the new tests pass?

@@ -214,7 +223,7 @@ def pull_all_from_table_or_query(

query = f"""
SELECT {field_string}
FROM {from_expression} AS paftoq_alias
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think someone added this in because it caused a crash without this? #2956

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had a similar issue. I thought it was caused by the fact data_source.get_table_query_string() always puts "()" around the from_expression. Even when from_expression is just a table name. I decided to adjust get_table_query_string() inspired by redshift_source.py. It's rather unfortunate that the context of #2954 isn't clear. because I had the exact same error. But I'm unsure if his fix works for me and vice versa. I think adding AS paftoq_alias and combining it with my version of get_table_query_string() would be the safest option.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah im not sure. But what you said as the safe option sounds good to me

@adchia adchia self-assigned this Aug 3, 2022
@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: AlexEijssen
To complete the pull request process, please assign adchia after the PR has been reviewed.
You can assign the PR to them by writing /assign @adchia in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

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

@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2022

Codecov Report

Merging #3002 (f182c77) into master (95be28c) will decrease coverage by 0.16%.
The diff coverage is 49.18%.

@@            Coverage Diff             @@
##           master    #3002      +/-   ##
==========================================
- Coverage   77.69%   77.53%   -0.17%     
==========================================
  Files         193      194       +1     
  Lines       16269    16298      +29     
==========================================
- Hits        12641    12637       -4     
- Misses       3628     3661      +33     
Flag Coverage Δ
integrationtests 67.23% <100.00%> (-0.28%) ⬇️
unittests 59.40% <42.62%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
..._stores/contrib/postgres_offline_store/postgres.py 35.71% <16.66%> (+0.57%) ⬆️
.../contrib/postgres_offline_store/postgres_source.py 50.66% <46.66%> (+1.64%) ⬆️
...line_stores/contrib/postgres_repo_configuration.py 100.00% <100.00%> (ø)
...line_stores/contrib/postgres_repo_configuration.py 100.00% <100.00%> (ø)
...sts/integration/registration/test_feature_store.py 100.00% <100.00%> (ø)
...n/tests/integration/registration/test_inference.py 100.00% <100.00%> (ø)
sdk/python/tests/utils/e2e_test_validation.py 88.88% <100.00%> (+1.01%) ⬆️
sdk/python/tests/utils/data_source_test_creator.py 56.66% <0.00%> (-43.34%) ⬇️
...thon/feast/infra/offline_stores/bigquery_source.py 85.45% <0.00%> (-2.73%) ⬇️
sdk/python/feast/inference.py 84.88% <0.00%> (-2.33%) ⬇️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@AlexEijssen
Copy link
Contributor Author

I'm not sure if my latest commit is what you meant by: "Mind removing the excluded tests and running to make sure the new tests pass?"

@adchia
Copy link
Collaborator

adchia commented Aug 4, 2022

I'm not sure if my latest commit is what you meant by: "Mind removing the excluded tests and running to make sure the new tests pass?"

I sent a PR in your repo to help with it, but had some trouble getting the normal get_historical_features tests to pass

@adchia
Copy link
Collaborator

adchia commented Aug 4, 2022

Are you on the Slack? Might be easier to discuss this syncrhonously in slack.feast.dev

@adchia
Copy link
Collaborator

adchia commented Aug 4, 2022

the postgres tests aren't being run continuously (mostly because we don't have anybody who is willing to "own" the component) so you'd actually have to manually run the male command to run the tests

@AlexEijssen AlexEijssen merged commit 63d541d into feast-dev:master Aug 9, 2022
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.

Add Postgres as a storage for creating saved datasets.
5 participants