Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changes to example notebook
Signed-off-by: Jacob Klegar <jacob@tecton.ai>
  • Loading branch information
jklegar committed Jan 27, 2021
commit f7a2ce995a757fed03ed27dfbe47c7dc74e02583
16 changes: 16 additions & 0 deletions examples/minimal/minimal_ride_hailing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,16 @@
" files = [\"s3://\" + path for path in fs.glob(uri + '/part-*')]\n",
" ds = ParquetDataset(files, filesystem=fs)\n",
" return ds.read().to_pandas()\n",
" elif parsed_uri.scheme == 'wasbs':\n",
" import adlfs\n",
" fs = adlfs.AzureBlobFileSystem(\n",
" account_name=os.getenv('FEAST_AZURE_BLOB_ACCOUNT_NAME'), account_key=os.getenv('FEAST_AZURE_BLOB_ACCOUNT_ACCESS_KEY')\n",
" )\n",
" uripath = parsed_uri.username + parsed_uri.path\n",
" files = fs.glob(uripath + '/part-*')\n",
" print(files)\n",
" ds = ParquetDataset(files, filesystem=fs)\n",
" return ds.read().to_pandas()\n",
" else:\n",
" raise ValueError(f\"Unsupported URL scheme {uri}\")"
]
Expand Down Expand Up @@ -1275,6 +1285,12 @@
"metadata": {},
"outputs": [],
"source": [
"# Note: depending on the Kafka configuration you may need to create the Kafka topic first, like below:\n",
"#from confluent_kafka.admin import AdminClient, NewTopic\n",
"#admin = AdminClient({'bootstrap.servers': KAFKA_BROKER})\n",
"#new_topic = NewTopic('driver_trips', num_partitions=1, replication_factor=3)\n",
"#admin.create_topics(new_topic)\n",
"\n",
"for record in trips_df.drop(columns=['created']).to_dict('record'):\n",
" record[\"datetime\"] = (\n",
" record[\"datetime\"].to_pydatetime().replace(tzinfo=pytz.utc)\n",
Expand Down
6 changes: 6 additions & 0 deletions infra/terraform/azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ terraform {
```

3. Use `terraform apply -var-file="my.tfvars"` to deploy.

Note: to get the list of Kafka brokers needed for streaming ingestion, use

`curl -sS -u <Kafka gateway username>:<Kafka gateway password> -G https://<Kafka cluster name>.azurehdinsight.net/api/v1/clusters/<Kafka cluster name>/services/KAFKA/components/KAFKA_BROKER | jq -r '["\(.host_components[].HostRoles.host_name):9092"] | join(",")'`

where the Kafka gateway username is <name_prefix>-kafka-gateway, the Kafka cluster name is <name_prefix>-kafka, and the Kafka gateway password is a kubectl secret under the name feast-kafka-gateway.