|
| 1 | +--- |
| 2 | +name: feast-dev |
| 3 | +description: Development guide for contributing to the Feast codebase. Covers environment setup, testing, linting, project structure, and PR workflow for feast-dev/feast. |
| 4 | +license: Apache-2.0 |
| 5 | +compatibility: Works with Claude Code, OpenAI Codex, and any Agent Skills compatible tool. Requires Python 3.10+, uv, and git. |
| 6 | +metadata: |
| 7 | + author: feast-dev |
| 8 | + version: "1.0" |
| 9 | +--- |
| 10 | + |
| 11 | +# Feast Development Guide |
| 12 | + |
| 13 | +## Environment Setup |
| 14 | + |
| 15 | +```bash |
| 16 | +# Install development dependencies (uses uv pip sync with pinned requirements) |
| 17 | +make install-python-dependencies-dev |
| 18 | + |
| 19 | +# Install minimal dependencies |
| 20 | +make install-python-dependencies-minimal |
| 21 | + |
| 22 | +# Install pre-commit hooks (runs formatters and linters on commit) |
| 23 | +make install-precommit |
| 24 | +``` |
| 25 | + |
| 26 | +## Running Tests |
| 27 | + |
| 28 | +### Unit Tests |
| 29 | +```bash |
| 30 | +# Run all unit tests |
| 31 | +make test-python-unit |
| 32 | + |
| 33 | +# Run a specific test file |
| 34 | +python -m pytest sdk/python/tests/unit/test_unit_feature_store.py -v |
| 35 | + |
| 36 | +# Run a specific test by name |
| 37 | +python -m pytest sdk/python/tests/unit/test_unit_feature_store.py -k "test_apply" -v |
| 38 | + |
| 39 | +# Run fast unit tests only (no external dependencies) |
| 40 | +make test-python-unit-fast |
| 41 | +``` |
| 42 | + |
| 43 | +### Integration Tests (local) |
| 44 | +```bash |
| 45 | +# Run integration tests in local dev mode |
| 46 | +make test-python-integration-local |
| 47 | +``` |
| 48 | + |
| 49 | +## Linting and Formatting |
| 50 | + |
| 51 | +```bash |
| 52 | +# Format Python code |
| 53 | +make format-python |
| 54 | + |
| 55 | +# Lint Python code |
| 56 | +make lint-python |
| 57 | + |
| 58 | +# Run all precommit checks (format + lint) |
| 59 | +make precommit-check |
| 60 | + |
| 61 | +# Type checking |
| 62 | +cd sdk/python && python -m mypy feast |
| 63 | +``` |
| 64 | + |
| 65 | +## Code Style |
| 66 | + |
| 67 | +- Use type hints on all function signatures |
| 68 | +- Use `from __future__ import annotations` at the top of new files |
| 69 | +- Follow existing patterns in the module you are modifying |
| 70 | +- PR titles must follow semantic conventions: `feat:`, `fix:`, `ci:`, `chore:`, `docs:` |
| 71 | +- Add a GitHub label to PRs (e.g. `kind/bug`, `kind/feature`, `kind/housekeeping`) |
| 72 | +- Sign off commits with `git commit -s` (DCO requirement) |
| 73 | + |
| 74 | +## Project Structure |
| 75 | + |
| 76 | +``` |
| 77 | +sdk/python/feast/ # Main Python SDK |
| 78 | + cli/cli.py # CLI entry point (feast apply, feast materialize, etc.) |
| 79 | + feature_store.py # FeatureStore class - core orchestration |
| 80 | + repo_config.py # feature_store.yaml configuration parsing |
| 81 | + repo_operations.py # feast apply / feast teardown logic |
| 82 | + infra/ # Online/offline store implementations |
| 83 | + online_stores/ # Redis, DynamoDB, SQLite, etc. |
| 84 | + offline_stores/ # BigQuery, Snowflake, File, etc. |
| 85 | + transformation/ # On-demand and streaming transformations |
| 86 | +protos/feast/ # Protobuf definitions |
| 87 | +sdk/python/tests/ # Test suite |
| 88 | + unit/ # Fast, no external deps |
| 89 | + integration/ # Requires infrastructure |
| 90 | +``` |
| 91 | + |
| 92 | +## Key Abstractions |
| 93 | + |
| 94 | +- **FeatureStore** (`feature_store.py`): Entry point for all operations |
| 95 | +- **FeatureView**: Defines a set of features from a data source |
| 96 | +- **OnDemandFeatureView**: Computed features using request-time transformations |
| 97 | +- **Entity**: Join key definition (e.g. driver_id, customer_id) |
| 98 | +- **DataSource**: Where raw data lives (BigQuery, files, Snowflake, etc.) |
| 99 | +- **OnlineStore**: Low-latency feature serving (Redis, DynamoDB, SQLite) |
| 100 | +- **OfflineStore**: Historical feature retrieval (BigQuery, Snowflake, file) |