File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
sdk/python/feast/infra/offline_stores/contrib/trino_offline_store Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -372,6 +372,8 @@ def get_historical_features(
372372 )
373373
374374 # Generate the Trino SQL query from the query context
375+ if type (entity_df ) is str :
376+ table_reference = f"({ entity_df } )"
375377 query = offline_utils .build_point_in_time_query (
376378 query_context ,
377379 left_table_query_string = table_reference ,
@@ -454,9 +456,7 @@ def _upload_entity_df_and_get_entity_schema(
454456) -> Dict [str , np .dtype ]:
455457 """Uploads a Pandas entity dataframe into a Trino table and returns the resulting table"""
456458 if type (entity_df ) is str :
457- client .execute_query (f"CREATE TABLE { table_name } AS ({ entity_df } )" )
458-
459- results = client .execute_query (f"SELECT * FROM { table_name } LIMIT 1" )
459+ results = client .execute_query (f"SELECT * FROM ({ entity_df } ) LIMIT 1" )
460460
461461 limited_entity_df = pd .DataFrame (
462462 data = results .data , columns = results .columns_names
You can’t perform that action at this time.
0 commit comments