Hi,
Using a Python snippet to access feast (feature store) on Postgres using the new ‘Python Script(Lab)’ node I encountered an error ‘ValueError: Unsupported type: extension<knime.logical_type>’. Running the same script in the ‘old’ node works without any problems. I’m working with KNIME 4.5.2 on WIN.
The task of the script below is to pass an input table, consisting of an INT (as the ID) and an ‘Local Date Time’ (ts) column, to the feast feature store for fetching the matching (via ID) records from the DB (Postgres). The error happens in the call ‘get_historical_features’.
Using the same script (adapted reg. IN/OUT) in the old Python Script node works fine!
Here my script - the Log of the Python node please find attached.
import knime_io as knio
# This example script creates an output table containing randomly drawn integers using numpy and pandas.
import numpy as np
import pandas as pd
from datetime import datetime, timedelta
from feast import FeatureStore
# The entity dataframe is the dataframe we want to enrich with feature values
entity_def = knio.input_tables[0].to_pandas()
store = FeatureStore(repo_path="C:/Data/feast_projects/feature_repo_pgsql")
training_df = store.get_historical_features(
entity_df=entity_def,
features=[
"driver_hourly_stats:conv_rate",
"driver_hourly_stats:acc_rate",
"driver_hourly_stats:avg_daily_trips",
],
).to_df()
knio.output_tables[0] = knio.write_table(training_df)
PyError.txt (4.6 KB)