Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/pr_duckdb_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.1
uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.63.1
pixi-version: v0.75.0
environments: duckdb-tests
cache: true
- name: Run DuckDB offline store integration tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr_ray_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.1
uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.63.1
pixi-version: v0.75.0
environments: ray-tests
cache: true
- name: Run Ray integration tests (offline store + compute engine)
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr_registration_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
persist-credentials: false
allow-unsafe-pr-checkout: true # Security: gated by label check above
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.1
uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.63.1
pixi-version: v0.75.0
environments: registration-tests
cache: true
- name: Run registration integration tests (local)
Expand Down Expand Up @@ -82,9 +82,9 @@ jobs:
- name: Install Hadoop dependencies
run: make install-hadoop-dependencies-ci
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.1
uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.63.1
pixi-version: v0.75.0
environments: registration-tests
cache: true
- name: Run registration integration tests (CI)
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ lock-python-dependencies-all: ## Recompile and lock all Python dependency sets f
"uv pip compile -p $(ver) --no-strip-extras pyproject.toml --extra minimal-sdist-build \
--no-emit-package milvus-lite \
--no-emit-package pymilvus \
--no-emit-package faiss-cpu \
--generate-hashes --output-file sdk/python/requirements/py$(ver)-minimal-sdist-requirements.txt" && \
pixi run --environment $(call get_env_name,$(ver)) --manifest-path infra/scripts/pixi/pixi.toml \
"uv pip install -p $(ver) pybuild-deps==0.5.0 pip==25.0.1 && \
"uv pip install -p $(ver) pybuild-deps==0.5.0 pip==25.0.1 typing_extensions && \
pybuild-deps compile --generate-hashes \
-o sdk/python/requirements/py$(ver)-minimal-sdist-requirements-build.txt \
sdk/python/requirements/py$(ver)-minimal-sdist-requirements.txt" && \
Expand Down
11,897 changes: 5,952 additions & 5,945 deletions pixi.lock

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies = [
"typeguard>=4.0.0",
"fastapi>=0.68.0",
"starlette>=1.0.1",
"uvicorn[standard]>=0.30.6,<=0.34.0",
"uvicorn[standard]>=0.30.6",
"uvicorn-worker",
"gunicorn; platform_system != 'Windows'",
"dask[dataframe]>=2024.2.1",
Expand Down Expand Up @@ -262,6 +262,10 @@ line-length = 88
target-version = "py310"
include = ["*.py", "*.pyi"]

[tool.ruff.lint]
# Keep on using old default rules: https://astral.sh/blog/ruff-v0.16.0
select = ["E4", "E7", "E9", "F"]

[tool.ruff.format]
# exclude a few common directories in the root of the project
exclude = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ feature_vector = store.get_online_features(
],
).to_dict()
pprint(feature_vector)

```
#### Output
```python
{'acc_rate': [0.01390857808291912, 0.4063614010810852],
'avg_daily_trips': [69, 706],
'conv_rate': [0.6624961495399475, 0.7595928311347961],
'driver_id': [1004, 1005]}
{
"acc_rate": [0.01390857808291912, 0.4063614010810852],
"avg_daily_trips": [69, 706],
"conv_rate": [0.6624961495399475, 0.7595928311347961],
"driver_id": [1004, 1005],
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ feature_vector = store.get_online_features(
],
).to_dict()
pprint(feature_vector)

```
#### Output
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ feature_vector = store.get_online_features(
],
).to_dict()
pprint(feature_vector)

```
#### Output
```
Expand Down
40 changes: 30 additions & 10 deletions sdk/python/feast/templates/pytorch_nlp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,15 @@ def load_artifacts(app: FastAPI):

# Update global references for easy access
import example_repo

example_repo._sentiment_model = app.state.sentiment_model
example_repo._lookup_tables = app.state.lookup_tables


# example_repo.py - Use pre-loaded artifacts
_sentiment_model = None # Set by static_artifacts.py


def sentiment_prediction(inputs):
global _sentiment_model
if _sentiment_model is not None:
Expand Down Expand Up @@ -296,16 +299,19 @@ def load_custom_embeddings():
embeddings_file = Path(__file__).parent / "data" / "user_embeddings.npy"
if embeddings_file.exists():
import numpy as np

return {"embeddings": np.load(embeddings_file)}
return None


def load_artifacts(app: FastAPI):
# Load your custom artifacts
app.state.custom_embeddings = load_custom_embeddings()
app.state.config_params = {"threshold": 0.7, "top_k": 10}

# Make them available to feature views
import example_repo

example_repo._custom_embeddings = app.state.custom_embeddings
```

Expand All @@ -326,11 +332,21 @@ store = FeatureStore(repo_path=".")
from datetime import datetime
import pandas as pd

entity_df = pd.DataFrame({
"text_id": ["text_0000", "text_0001", "text_0002"],
"user_id": ["user_080", "user_091", "user_052"], # Use actual generated user IDs
"event_timestamp": [datetime.now(), datetime.now(), datetime.now()] # Current timestamps
})
entity_df = pd.DataFrame(
{
"text_id": ["text_0000", "text_0001", "text_0002"],
"user_id": [
"user_080",
"user_091",
"user_052",
], # Use actual generated user IDs
"event_timestamp": [
datetime.now(),
datetime.now(),
datetime.now(),
], # Current timestamps
}
)

training_df = store.get_historical_features(
entity_df=entity_df,
Expand All @@ -352,7 +368,7 @@ print(training_df.head())
# Get features for online serving (use actual entity combinations)
entity_rows = [
{"text_id": "text_0000", "user_id": "user_080"},
{"text_id": "text_0001", "user_id": "user_091"}
{"text_id": "text_0001", "user_id": "user_091"},
]

online_features = store.get_online_features(
Expand All @@ -367,10 +383,12 @@ print("Online features:", online_features)

```python
# Real-time sentiment analysis
prediction_rows = [{
"input_text": "I love this product!",
"model_name": "cardiffnlp/twitter-roberta-base-sentiment-latest"
}]
prediction_rows = [
{
"input_text": "I love this product!",
"model_name": "cardiffnlp/twitter-roberta-base-sentiment-latest",
}
]

predictions = store.get_online_features(
features=[
Expand Down Expand Up @@ -473,12 +491,14 @@ curl -X POST \

### Adding New Features

<!-- fmt:off -->
```python
# In example_repo.py, add to text_features_fv schema:
Field(name="hashtag_count", dtype=Int64, description="Number of hashtags"),
Field(name="mention_count", dtype=Int64, description="Number of @mentions"),
Field(name="url_count", dtype=Int64, description="Number of URLs"),
```
<!-- fmt:on -->

### Using Different Models

Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/templates/ray_rag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ results = store.retrieve_online_documents_v2(

# Display results with metadata
for i in range(len(results["document_id_pk"])):
print(f"{i+1}. {results['movie_name'][i]}")
print(f"{i + 1}. {results['movie_name'][i]}")
print(f" Director: {results['movie_director'][i]}")
print(f" Distance: {results['distance'][i]:.3f}")
```
Expand Down
Loading
Loading