From ecf2c18896ec84e427328f581e36407b06c1973b Mon Sep 17 00:00:00 2001 From: Leonid Date: Wed, 21 Apr 2021 01:21:51 +0000 Subject: [PATCH] fix template --- sdk/python/feast/infra/aws_dynamo_provider.py | 16 ----------- .../templates/aws_dynamo/feature_store.yaml | 1 - sdk/python/feast/templates/aws_dynamo/test.py | 27 +------------------ 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/sdk/python/feast/infra/aws_dynamo_provider.py b/sdk/python/feast/infra/aws_dynamo_provider.py index 846514ce4a..57444404bd 100644 --- a/sdk/python/feast/infra/aws_dynamo_provider.py +++ b/sdk/python/feast/infra/aws_dynamo_provider.py @@ -46,7 +46,6 @@ def update_infra( dynamodb = self._initialize_dynamodb() for table_name in tables_to_keep: - # TODO: add table creation to dynamo. table = None try: table = dynamodb.create_table( @@ -82,16 +81,6 @@ def update_infra( if ce.response['Error']['Code'] == 'ResourceNotFoundException': table = dynamodb.Table(table_name.name) - # table.update_item( - # Key={ - # "Project": project - # }, - # UpdateExpression='SET created_ts = :val1', - # ExpressionAttributeValues={ - # ':val1': datetime.utcnow().strftime("") - # } - # ) - for table_name in tables_to_delete: table = dynamodb.Table(table_name.name) table.delete() @@ -144,17 +133,12 @@ def online_read( for entity_key in entity_keys: table_instace = dynamodb.Table(table.name) document_id = compute_datastore_entity_id(entity_key) # TODO check id - print("entity") - print(entity_key) - print("id") - print(document_id) response = table_instace.get_item( Key={ "Row": document_id, "Project": project } ) - print(response) value = response['Item'] if value is not None: diff --git a/sdk/python/feast/templates/aws_dynamo/feature_store.yaml b/sdk/python/feast/templates/aws_dynamo/feature_store.yaml index 1a4363e349..7d2dab35b5 100644 --- a/sdk/python/feast/templates/aws_dynamo/feature_store.yaml +++ b/sdk/python/feast/templates/aws_dynamo/feature_store.yaml @@ -1,4 +1,3 @@ project: my_project registry: s3://feast-provectus-demo/data/registry.db provider: aws_dynamo -online_store: diff --git a/sdk/python/feast/templates/aws_dynamo/test.py b/sdk/python/feast/templates/aws_dynamo/test.py index e5d3e327a1..7ba3cee584 100644 --- a/sdk/python/feast/templates/aws_dynamo/test.py +++ b/sdk/python/feast/templates/aws_dynamo/test.py @@ -1,7 +1,7 @@ from datetime import datetime, timedelta import pandas as pd -from drivers_example import driver, driver_hourly_stats_view +from driver_example import driver, driver_hourly_stats_view from feast import FeatureStore @@ -20,31 +20,6 @@ def main(): # Select features feature_refs = ["driver_hourly_stats:conv_rate", "driver_hourly_stats:acc_rate"] - # # Create an entity dataframe. This is the dataframe that will be enriched with historical features - # entity_df = pd.DataFrame( - # { - # "event_timestamp": [ - # pd.Timestamp(dt, unit="ms", tz="UTC").round("ms") - # for dt in pd.date_range( - # start=datetime.now() - timedelta(days=3), - # end=datetime.now(), - # periods=3, - # ) - # ], - # "driver_id": [1001, 1002, 1003], - # } - # ) - - # print("Retrieving training data...") - - # # Retrieve historical features by joining the entity dataframe to the BigQuery table source - # training_df = fs.get_historical_features( - # feature_refs=feature_refs, entity_df=entity_df - # ).to_df() - - # print() - # print(training_df) - # print() print("Loading features into the online store...") fs.materialize_incremental(end_date=datetime.now())