Skip to content
Prev Previous commit
Next Next commit
Update basic Feast example to Feast 0.4 (#424)
  • Loading branch information
woop authored and Shu Heng committed Feb 13, 2020
commit 4275d413f09bdcfd515180ef78b1ea5252c9805f
61 changes: 31 additions & 30 deletions examples/basic/basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Feast Basic Customer Transactions Example"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -48,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -73,7 +71,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -84,11 +82,13 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"client = Client(core_url=CORE_URL, serving_url=BATCH_SERVING_URL) # Connect to Feast Core"
"client = Client(core_url=CORE_URL, serving_url=BATCH_SERVING_URL) # Connect to Feast Core\n",
"client.create_project('customer_project')\n",
"client.set_project('customer_project')"
]
},
{
Expand All @@ -107,7 +107,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -119,7 +119,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -154,7 +154,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -174,7 +174,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -197,7 +197,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -213,7 +213,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -230,7 +230,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -255,7 +255,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -280,14 +280,14 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"job = client.get_batch_features(\n",
" feature_ids=[\n",
" f\"customer_transactions:{customer_fs.version}:daily_transactions\", \n",
" f\"customer_transactions:{customer_fs.version}:total_transactions\", \n",
" feature_refs=[\n",
" f\"daily_transactions\", \n",
" f\"total_transactions\", \n",
" ],\n",
" entity_rows=entity_rows\n",
" )\n",
Expand All @@ -311,11 +311,12 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"online_client = Client(core_url=CORE_URL, serving_url=ONLINE_SERVING_URL)"
"online_client = Client(core_url=CORE_URL, serving_url=ONLINE_SERVING_URL)\n",
"online_client.set_project(\"customer_project\")"
]
},
{
Expand All @@ -327,14 +328,14 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"online_features = online_client.get_online_features(\n",
" feature_ids=[\n",
" f\"customer_transactions:{customer_fs.version}:daily_transactions\",\n",
" f\"customer_transactions:{customer_fs.version}:total_transactions\",\n",
" feature_refs=[\n",
" f\"daily_transactions\",\n",
" f\"total_transactions\",\n",
" ],\n",
" entity_rows=[\n",
" GetOnlineFeaturesRequest.EntityRow(\n",
Expand Down Expand Up @@ -373,18 +374,18 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.3"
},
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
},
"source": []
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
}