\n",
+ "
\n",
+ "
\n",
"\n",
+ "\n",
+ " \n",
+ "
\n",
+ "
\n",
+ " "
]
},
"metadata": {},
- "execution_count": 5
+ "execution_count": 4
}
]
},
@@ -438,53 +529,54 @@
"base_uri": "https://localhost:8080/"
},
"id": "DPqXCoNpL0SX",
- "outputId": "a252e224-61da-48ee-92b8-1780def99244"
+ "outputId": "be1308b2-0c83-4dd3-eb88-e79ffcbd20d6"
},
"source": [
"!pygmentize -f terminal16m example.py"
],
- "execution_count": null,
+ "execution_count": 5,
"outputs": [
{
"output_type": "stream",
+ "name": "stdout",
"text": [
- "\u001b[38;2;64;128;128m# This is an example feature definition file\u001b[39m\n",
+ "\u001b[38;2;64;128;128;03m# This is an example feature definition file\u001b[39;00m\n",
"\n",
- "\u001b[38;2;0;128;0;01mfrom\u001b[39;00m \u001b[38;2;0;0;255;01mgoogle.protobuf.duration_pb2\u001b[39;00m \u001b[38;2;0;128;0;01mimport\u001b[39;00m Duration\n",
+ "\u001b[38;2;0;128;0;01mfrom\u001b[39;00m \u001b[38;2;0;0;255;01mdatetime\u001b[39;00m \u001b[38;2;0;128;0;01mimport\u001b[39;00m timedelta\n",
"\n",
- "\u001b[38;2;0;128;0;01mfrom\u001b[39;00m \u001b[38;2;0;0;255;01mfeast\u001b[39;00m \u001b[38;2;0;128;0;01mimport\u001b[39;00m Entity, Feature, FeatureView, FileSource, ValueType\n",
+ "\u001b[38;2;0;128;0;01mfrom\u001b[39;00m \u001b[38;2;0;0;255;01mfeast\u001b[39;00m \u001b[38;2;0;128;0;01mimport\u001b[39;00m Entity, FeatureView, Field, FileSource, ValueType\n",
+ "\u001b[38;2;0;128;0;01mfrom\u001b[39;00m \u001b[38;2;0;0;255;01mfeast\u001b[39;00m\u001b[38;2;0;0;255;01m.\u001b[39;00m\u001b[38;2;0;0;255;01mtypes\u001b[39;00m \u001b[38;2;0;128;0;01mimport\u001b[39;00m Float32, Int64\n",
"\n",
- "\u001b[38;2;64;128;128m# Read data from parquet files. Parquet is convenient for local development mode. For\u001b[39m\n",
- "\u001b[38;2;64;128;128m# production, you can use your favorite DWH, such as BigQuery. See Feast documentation\u001b[39m\n",
- "\u001b[38;2;64;128;128m# for more info.\u001b[39m\n",
+ "\u001b[38;2;64;128;128;03m# Read data from parquet files. Parquet is convenient for local development mode. For\u001b[39;00m\n",
+ "\u001b[38;2;64;128;128;03m# production, you can use your favorite DWH, such as BigQuery. See Feast documentation\u001b[39;00m\n",
+ "\u001b[38;2;64;128;128;03m# for more info.\u001b[39;00m\n",
"driver_hourly_stats \u001b[38;2;102;102;102m=\u001b[39m FileSource(\n",
" path\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33m/content/feature_repo/data/driver_stats.parquet\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m,\n",
- " event_timestamp_column\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mevent_timestamp\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m,\n",
+ " timestamp_field\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mevent_timestamp\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m,\n",
" created_timestamp_column\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mcreated\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m,\n",
")\n",
"\n",
- "\u001b[38;2;64;128;128m# Define an entity for the driver. You can think of entity as a primary key used to\u001b[39m\n",
- "\u001b[38;2;64;128;128m# fetch features.\u001b[39m\n",
- "driver \u001b[38;2;102;102;102m=\u001b[39m Entity(name\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mdriver_id\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m, value_type\u001b[38;2;102;102;102m=\u001b[39mValueType\u001b[38;2;102;102;102m.\u001b[39mINT64, description\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mdriver id\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m,)\n",
+ "\u001b[38;2;64;128;128;03m# Define an entity for the driver. You can think of entity as a primary key used to\u001b[39;00m\n",
+ "\u001b[38;2;64;128;128;03m# fetch features.\u001b[39;00m\n",
+ "driver \u001b[38;2;102;102;102m=\u001b[39m Entity(name\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mdriver\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m, value_type\u001b[38;2;102;102;102m=\u001b[39mValueType\u001b[38;2;102;102;102m.\u001b[39mINT64, join_key\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mdriver_id\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m,)\n",
"\n",
- "\u001b[38;2;64;128;128m# Our parquet files contain sample data that includes a driver_id column, timestamps and\u001b[39m\n",
- "\u001b[38;2;64;128;128m# three feature column. Here we define a Feature View that will allow us to serve this\u001b[39m\n",
- "\u001b[38;2;64;128;128m# data to our model online.\u001b[39m\n",
+ "\u001b[38;2;64;128;128;03m# Our parquet files contain sample data that includes a driver_id column, timestamps and\u001b[39;00m\n",
+ "\u001b[38;2;64;128;128;03m# three feature column. Here we define a Feature View that will allow us to serve this\u001b[39;00m\n",
+ "\u001b[38;2;64;128;128;03m# data to our model online.\u001b[39;00m\n",
"driver_hourly_stats_view \u001b[38;2;102;102;102m=\u001b[39m FeatureView(\n",
" name\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mdriver_hourly_stats\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m,\n",
- " entities\u001b[38;2;102;102;102m=\u001b[39m[\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mdriver_id\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m],\n",
- " ttl\u001b[38;2;102;102;102m=\u001b[39mDuration(seconds\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;102;102;102m86400\u001b[39m \u001b[38;2;102;102;102m*\u001b[39m \u001b[38;2;102;102;102m1\u001b[39m),\n",
- " features\u001b[38;2;102;102;102m=\u001b[39m[\n",
- " Feature(name\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mconv_rate\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m, dtype\u001b[38;2;102;102;102m=\u001b[39mValueType\u001b[38;2;102;102;102m.\u001b[39mFLOAT),\n",
- " Feature(name\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33macc_rate\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m, dtype\u001b[38;2;102;102;102m=\u001b[39mValueType\u001b[38;2;102;102;102m.\u001b[39mFLOAT),\n",
- " Feature(name\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mavg_daily_trips\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m, dtype\u001b[38;2;102;102;102m=\u001b[39mValueType\u001b[38;2;102;102;102m.\u001b[39mINT64),\n",
+ " entities\u001b[38;2;102;102;102m=\u001b[39m[\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mdriver\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m],\n",
+ " ttl\u001b[38;2;102;102;102m=\u001b[39mtimedelta(days\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;102;102;102m1\u001b[39m),\n",
+ " schema\u001b[38;2;102;102;102m=\u001b[39m[\n",
+ " Field(name\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mconv_rate\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m, dtype\u001b[38;2;102;102;102m=\u001b[39mFloat32),\n",
+ " Field(name\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33macc_rate\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m, dtype\u001b[38;2;102;102;102m=\u001b[39mFloat32),\n",
+ " Field(name\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m\u001b[38;2;186;33;33mavg_daily_trips\u001b[39m\u001b[38;2;186;33;33m\"\u001b[39m, dtype\u001b[38;2;102;102;102m=\u001b[39mInt64),\n",
" ],\n",
- " online\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;0;128;0mTrue\u001b[39m,\n",
- " batch_source\u001b[38;2;102;102;102m=\u001b[39mdriver_hourly_stats,\n",
+ " online\u001b[38;2;102;102;102m=\u001b[39m\u001b[38;2;0;128;0;01mTrue\u001b[39;00m,\n",
+ " source\u001b[38;2;102;102;102m=\u001b[39mdriver_hourly_stats,\n",
" tags\u001b[38;2;102;102;102m=\u001b[39m{},\n",
")\n"
- ],
- "name": "stdout"
+ ]
}
]
},
@@ -505,21 +597,23 @@
"base_uri": "https://localhost:8080/"
},
"id": "RYKCKKrcxYZG",
- "outputId": "d36b3fb2-9292-4b43-f26a-5441c301c92d"
+ "outputId": "9745d7eb-b4b8-4a43-bf47-189bbf07ae09"
},
"source": [
"!feast apply"
],
- "execution_count": null,
+ "execution_count": 6,
"outputs": [
{
"output_type": "stream",
+ "name": "stdout",
"text": [
- "Registered entity \u001b[1m\u001b[32mdriver_id\u001b[0m\n",
- "Registered feature view \u001b[1m\u001b[32mdriver_hourly_stats\u001b[0m\n",
- "Deploying infrastructure for \u001b[1m\u001b[32mdriver_hourly_stats\u001b[0m\n"
- ],
- "name": "stdout"
+ "Created entity \u001b[1m\u001b[32mdriver_id\u001b[0m\n",
+ "Created feature view \u001b[1m\u001b[32mdriver_hourly_stats\u001b[0m\n",
+ "\n",
+ "Created sqlite table \u001b[1m\u001b[32mfeature_repo_driver_hourly_stats\u001b[0m\n",
+ "\n"
+ ]
}
]
},
@@ -544,7 +638,7 @@
"base_uri": "https://localhost:8080/"
},
"id": "C6Fzia7YwBzz",
- "outputId": "250e9be1-2283-4d74-cf48-297b8ae0d23a"
+ "outputId": "b99aedae-9c47-4b9f-acdd-cd02e2e091b7"
},
"source": [
"from datetime import datetime, timedelta\n",
@@ -583,21 +677,22 @@
"print(\"----- Example features -----\\n\")\n",
"print(training_df.head())"
],
- "execution_count": null,
+ "execution_count": 7,
"outputs": [
{
"output_type": "stream",
+ "name": "stdout",
"text": [
"----- Feature schema -----\n",
"\n",
"
\n",
- "Int64Index: 3 entries, 0 to 2\n",
+ "Int64Index: 3 entries, 720 to 1081\n",
"Data columns (total 6 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
- " 0 event_timestamp 3 non-null datetime64[ns, UTC]\n",
- " 1 driver_id 3 non-null int64 \n",
- " 2 label_driver_reported_satisfaction 3 non-null int64 \n",
+ " 0 driver_id 3 non-null int64 \n",
+ " 1 label_driver_reported_satisfaction 3 non-null int64 \n",
+ " 2 event_timestamp 3 non-null datetime64[ns, UTC]\n",
" 3 conv_rate 3 non-null float32 \n",
" 4 acc_rate 3 non-null float32 \n",
" 5 avg_daily_trips 3 non-null int32 \n",
@@ -607,14 +702,16 @@
"\n",
"----- Example features -----\n",
"\n",
- " event_timestamp driver_id ... acc_rate avg_daily_trips\n",
- "0 2021-08-23 15:12:55.489091+00:00 1003 ... 0.120588 938\n",
- "1 2021-08-23 15:49:55.489089+00:00 1002 ... 0.504881 635\n",
- "2 2021-08-23 16:14:55.489075+00:00 1001 ... 0.138416 606\n",
+ " driver_id label_driver_reported_satisfaction \\\n",
+ "720 1002 5 \n",
+ "359 1001 1 \n",
+ "1081 1003 3 \n",
"\n",
- "[3 rows x 6 columns]\n"
- ],
- "name": "stdout"
+ " event_timestamp conv_rate acc_rate avg_daily_trips \n",
+ "720 2022-04-15 13:58:30.900257+00:00 0.368052 0.417923 346 \n",
+ "359 2022-04-15 14:23:30.900240+00:00 0.003188 0.535501 593 \n",
+ "1081 2022-04-15 13:21:30.900260+00:00 0.214944 0.788695 904 \n"
+ ]
}
]
},
@@ -645,23 +742,23 @@
"colab": {
"base_uri": "https://localhost:8080/"
},
- "outputId": "efbb493a-89a2-41ce-b3b4-d0d05131a8ff"
+ "outputId": "d38a0e0a-2802-4408-ab92-a26baf82752e"
},
"source": [
"from datetime import datetime\n",
"!feast materialize-incremental {datetime.now().isoformat()}"
],
- "execution_count": null,
+ "execution_count": 8,
"outputs": [
{
"output_type": "stream",
+ "name": "stdout",
"text": [
- "Materializing \u001b[1m\u001b[32m1\u001b[0m feature views to \u001b[1m\u001b[32m2021-08-23 16:25:46+00:00\u001b[0m into the \u001b[1m\u001b[32msqlite\u001b[0m online store.\n",
+ "Materializing \u001b[1m\u001b[32m1\u001b[0m feature views to \u001b[1m\u001b[32m2022-04-15 14:34:37+00:00\u001b[0m into the \u001b[1m\u001b[32msqlite\u001b[0m online store.\n",
"\n",
- "\u001b[1m\u001b[32mdriver_hourly_stats\u001b[0m from \u001b[1m\u001b[32m2021-08-22 16:25:47+00:00\u001b[0m to \u001b[1m\u001b[32m2021-08-23 16:25:46+00:00\u001b[0m:\n",
- "\r 0%| | 0/5 [00:00, ?it/s]\r100%|████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 592.05it/s]\n"
- ],
- "name": "stdout"
+ "\u001b[1m\u001b[32mdriver_hourly_stats\u001b[0m from \u001b[1m\u001b[32m2022-04-14 14:34:38+00:00\u001b[0m to \u001b[1m\u001b[32m2022-04-15 14:34:37+00:00\u001b[0m:\n",
+ "100%|████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 434.17it/s]\n"
+ ]
}
]
},
@@ -683,7 +780,7 @@
"base_uri": "https://localhost:8080/"
},
"id": "aVIgSYhI4cvR",
- "outputId": "c91be624-3646-413d-a9df-8d29e8c85bb1"
+ "outputId": "eada224a-bd86-4933-f0ce-5e66870918cc"
},
"source": [
"print(\"--- Data directory ---\")\n",
@@ -698,18 +795,18 @@
" \"SELECT * FROM feature_repo_driver_hourly_stats\", con).columns.tolist())\n",
"con.close()"
],
- "execution_count": null,
+ "execution_count": 9,
"outputs": [
{
"output_type": "stream",
+ "name": "stdout",
"text": [
"--- Data directory ---\n",
"driver_stats.parquet online_store.db registry.db\n",
"\n",
"--- Schema of online store ---\n",
"['entity_key', 'feature_name', 'value', 'event_ts', 'created_ts']\n"
- ],
- "name": "stdout"
+ ]
}
]
},
@@ -750,7 +847,7 @@
"base_uri": "https://localhost:8080/"
},
"id": "a-PUsUWUxoH9",
- "outputId": "78b12b00-4718-41c6-a33a-2d56f47bd05c"
+ "outputId": "7acecf34-8e5a-4a87-caa8-c2bff39d1376"
},
"source": [
"from pprint import pprint\n",
@@ -772,17 +869,17 @@
"\n",
"pprint(feature_vector)"
],
- "execution_count": null,
+ "execution_count": 10,
"outputs": [
{
"output_type": "stream",
+ "name": "stdout",
"text": [
- "{'acc_rate': [0.5732735991477966, 0.7828438878059387],\n",
- " 'avg_daily_trips': [33, 984],\n",
- " 'conv_rate': [0.15498852729797363, 0.6263588070869446],\n",
+ "{'acc_rate': [0.29913440346717834, 0.4562472701072693],\n",
+ " 'avg_daily_trips': [474, 261],\n",
+ " 'conv_rate': [0.20237785577774048, 0.30597227811813354],\n",
" 'driver_id': [1004, 1005]}\n"
- ],
- "name": "stdout"
+ ]
}
]
},
diff --git a/sdk/python/feast/templates/aws/driver_repo.py b/sdk/python/feast/templates/aws/driver_repo.py
index 19ba44807b..04c3ea3b9c 100644
--- a/sdk/python/feast/templates/aws/driver_repo.py
+++ b/sdk/python/feast/templates/aws/driver_repo.py
@@ -8,7 +8,7 @@
# construction of feature vectors
driver = Entity(
# Name of the entity. Must be unique within a project
- name="driver_id",
+ name="driver",
# The join key of an entity describes the storage level field/column on which
# features can be looked up. The join key is also used to join feature
# tables/views when building feature vectors
@@ -41,7 +41,7 @@
# The list of entities specifies the keys required for joining or looking
# up features from this feature view. The reference provided in this field
# correspond to the name of a defined entity (or entities)
- entities=["driver_id"],
+ entities=["driver"],
# The timedelta is the maximum age that each feature value may have
# relative to its lookup time. For historical features (used in training),
# TTL is relative to each timestamp provided in the entity dataframe.
@@ -60,7 +60,7 @@
# Batch sources are used to find feature values. In the case of this feature
# view we will query a source table on Redshift for driver statistics
# features
- batch_source=driver_stats_source,
+ source=driver_stats_source,
# Tags are user defined key/value pairs that are attached to each
# feature view
tags={"team": "driver_performance"},
diff --git a/sdk/python/feast/templates/gcp/driver_repo.py b/sdk/python/feast/templates/gcp/driver_repo.py
index e494e021f2..7c686cdb6f 100644
--- a/sdk/python/feast/templates/gcp/driver_repo.py
+++ b/sdk/python/feast/templates/gcp/driver_repo.py
@@ -8,7 +8,7 @@
# construction of feature vectors
driver = Entity(
# Name of the entity. Must be unique within a project
- name="driver_id",
+ name="driver",
# The join key of an entity describes the storage level field/column on which
# features can be looked up. The join key is also used to join feature
# tables/views when building feature vectors
@@ -39,7 +39,7 @@
# The list of entities specifies the keys required for joining or looking
# up features from this feature view. The reference provided in this field
# correspond to the name of a defined entity (or entities)
- entities=["driver_id"],
+ entities=["driver"],
# The timedelta is the maximum age that each feature value may have
# relative to its lookup time. For historical features (used in training),
# TTL is relative to each timestamp provided in the entity dataframe.
@@ -58,7 +58,7 @@
# Batch sources are used to find feature values. In the case of this feature
# view we will query a source table on BigQuery for driver statistics
# features
- batch_source=driver_stats_source,
+ source=driver_stats_source,
# Tags are user defined key/value pairs that are attached to each
# feature view
tags={"team": "driver_performance"},
diff --git a/sdk/python/feast/templates/local/example.py b/sdk/python/feast/templates/local/example.py
index 076a331f91..56d24e60a5 100644
--- a/sdk/python/feast/templates/local/example.py
+++ b/sdk/python/feast/templates/local/example.py
@@ -16,14 +16,14 @@
# Define an entity for the driver. You can think of entity as a primary key used to
# fetch features.
-driver = Entity(name="driver_id", value_type=ValueType.INT64, description="driver id",)
+driver = Entity(name="driver", join_key="driver_id", value_type=ValueType.INT64,)
# Our parquet files contain sample data that includes a driver_id column, timestamps and
# three feature column. Here we define a Feature View that will allow us to serve this
# data to our model online.
driver_hourly_stats_view = FeatureView(
name="driver_hourly_stats",
- entities=["driver_id"],
+ entities=["driver"],
ttl=timedelta(days=1),
schema=[
Field(name="conv_rate", dtype=Float32),
@@ -31,6 +31,6 @@
Field(name="avg_daily_trips", dtype=Int64),
],
online=True,
- batch_source=driver_hourly_stats,
+ source=driver_hourly_stats,
tags={},
)
diff --git a/sdk/python/feast/templates/snowflake/driver_repo.py b/sdk/python/feast/templates/snowflake/driver_repo.py
index c14e4c38cc..55a25d445c 100644
--- a/sdk/python/feast/templates/snowflake/driver_repo.py
+++ b/sdk/python/feast/templates/snowflake/driver_repo.py
@@ -10,7 +10,7 @@
# construction of feature vectors
driver = Entity(
# Name of the entity. Must be unique within a project
- name="driver_id",
+ name="driver",
# The join key of an entity describes the storage level field/column on which
# features can be looked up. The join key is also used to join feature
# tables/views when building feature vectors
@@ -43,7 +43,7 @@
# The list of entities specifies the keys required for joining or looking
# up features from this feature view. The reference provided in this field
# correspond to the name of a defined entity (or entities)
- entities=["driver_id"],
+ entities=["driver"],
# The timedelta is the maximum age that each feature value may have
# relative to its lookup time. For historical features (used in training),
# TTL is relative to each timestamp provided in the entity dataframe.
diff --git a/sdk/python/feast/templates/spark/example.py b/sdk/python/feast/templates/spark/example.py
index c8c1c1257e..58f3df740f 100644
--- a/sdk/python/feast/templates/spark/example.py
+++ b/sdk/python/feast/templates/spark/example.py
@@ -16,9 +16,9 @@
# Entity definitions
-driver = Entity(name="driver_id", value_type=ValueType.INT64, description="driver id",)
+driver = Entity(name="driver", value_type=ValueType.INT64, description="driver id",)
customer = Entity(
- name="customer_id", value_type=ValueType.INT64, description="customer id",
+ name="customer", value_type=ValueType.INT64, description="customer id",
)
# Sources
@@ -40,7 +40,7 @@
# Feature Views
driver_hourly_stats_view = FeatureView(
name="driver_hourly_stats",
- entities=["driver_id"],
+ entities=["driver"],
ttl=timedelta(days=7),
schema=[
Field(name="conv_rate", dtype=Float32),
@@ -48,12 +48,12 @@
Field(name="avg_daily_trips", dtype=Int64),
],
online=True,
- batch_source=driver_hourly_stats,
+ source=driver_hourly_stats,
tags={},
)
customer_daily_profile_view = FeatureView(
name="customer_daily_profile",
- entities=["customer_id"],
+ entities=["customer"],
ttl=timedelta(days=7),
schema=[
Field(name="current_balance", dtype=Float32),
@@ -61,6 +61,6 @@
Field(name="lifetime_trip_count", dtype=Int64),
],
online=True,
- batch_source=customer_daily_profile,
+ source=customer_daily_profile,
tags={},
)
diff --git a/sdk/python/tests/utils/online_write_benchmark.py b/sdk/python/tests/utils/online_write_benchmark.py
index 6d6b73d5da..82ffc8e98b 100644
--- a/sdk/python/tests/utils/online_write_benchmark.py
+++ b/sdk/python/tests/utils/online_write_benchmark.py
@@ -29,7 +29,7 @@ def create_driver_hourly_stats_feature_view(source):
Field(name="acc_rate", dtype=Float32),
Field(name="avg_daily_trips", dtype=Int32),
],
- batch_source=source,
+ source=source,
ttl=timedelta(hours=2),
)
return driver_stats_feature_view