Skip to content
Merged
Changes from all commits
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
17 changes: 13 additions & 4 deletions docs/reference/denormalized.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Denormalized makes it easy to compute real-time features and write them directly

## Prerequisites

- Python 3.8+
- Kafka cluster (local or remote)
- Python 3.12+
- Kafka cluster (local or remote) OR docker installed

For a full working demo, check out the [feast-example](https://github.com/probably-nothing-labs/feast-example) repo.

Expand Down Expand Up @@ -39,6 +39,13 @@ my-feature-project/
└── main.py # Pipeline runner
```

3. Run a test Kafka instance in docker

`docker run --rm -p 9092:9092 emgeee/kafka_emit_measurements:latest`

This will spin up a docker container that runs a kafka instance and run a simple script to emit fake data to two topics.


## Define Your Features

In `feature_repo/sensor_data.py`, define your feature view and entity:
Expand Down Expand Up @@ -85,7 +92,7 @@ sample_event = {
}

# Create a stream from your Kafka topic
ds = FeastDataStream(Context().from_topic("temperature", json.dumps(sample_event), "localhost:9092"))
ds = FeastDataStream(Context().from_topic("temperature", json.dumps(sample_event), "localhost:9092", "occurred_at_ms"))

# Define your feature computations
ds = ds.window(
Expand All @@ -106,7 +113,9 @@ feature_store = FeatureStore(repo_path="feature_repo/")
ds.write_feast_feature(feature_store, "push_sensor_statistics")
```



## Need Help?

- Email us at hello@denormalized.io
- Check out more examples on our [GitHub](https://github.com/probably-nothing-labs/denormalized)
- Check out more examples on our [GitHub](https://github.com/probably-nothing-labs/denormalized/tree/main/py-denormalized/python/examples)