Skip to content

Commit

Permalink
fix template
Browse files Browse the repository at this point in the history
  • Loading branch information
leonid133 committed Apr 21, 2021
1 parent 33d01aa commit ecf2c18
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 43 deletions.
16 changes: 0 additions & 16 deletions sdk/python/feast/infra/aws_dynamo_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion sdk/python/feast/templates/aws_dynamo/feature_store.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
project: my_project
registry: s3://feast-provectus-demo/data/registry.db
provider: aws_dynamo
online_store:
27 changes: 1 addition & 26 deletions sdk/python/feast/templates/aws_dynamo/test.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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())
Expand Down

0 comments on commit ecf2c18

Please sign in to comment.