Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
67d79f7
Initial commit on INTPYTHON-297-MongoDB-Feast-Integration
caseyclements Jan 20, 2026
4d0f066
Added mongodb to project.optional-dependencies in pyproject.toml. Now…
caseyclements Jan 20, 2026
18b16b9
Checkpoint. Passing tests.unit.online_store.test_online_writes.TestOn…
caseyclements Feb 12, 2026
a066a99
Handle Nan in dfs for test_online_writes.py. Now all tests in the mod…
caseyclements Feb 13, 2026
7c17759
Removed suffix of implementation: mongodb_openai -> mongodb
caseyclements Feb 13, 2026
c463f4a
Moved MongoDBOnlineStore to feast.infra.online_store.contrib
caseyclements Feb 19, 2026
a6db5c7
Formatting
caseyclements Feb 19, 2026
9ed89f0
Refactor online_read that converts bson to proto. Left two methods fo…
caseyclements Feb 19, 2026
40e5ea5
Remove file added early during discovery
caseyclements Feb 19, 2026
67f2c99
Formatting
caseyclements Feb 19, 2026
35b66f0
Added version of test that uses testcontainers mongodb instead of ass…
caseyclements Feb 20, 2026
a526a0c
Create Make target for universal tests
caseyclements Feb 20, 2026
b0d57f5
Cleanup
caseyclements Feb 20, 2026
5a94a11
Removed temporary integration tests requiring one to spin up own mong…
caseyclements Feb 20, 2026
46898b5
Format
caseyclements Feb 20, 2026
0356261
Typing
caseyclements Feb 20, 2026
960881d
Implemented ASync API and Tests
caseyclements Feb 21, 2026
52948a2
Removed offline store stubs. The first PR will only contain the Onlin…
caseyclements Feb 23, 2026
f2e5dff
Moved mongodb_online_store out of cobtrib package.
caseyclements Feb 23, 2026
7f5a192
Add documentation.
caseyclements Feb 24, 2026
619fdd3
Cleanups and docstrings
caseyclements Feb 24, 2026
1f46d8e
Fixed another reference to contrib dir
caseyclements Feb 24, 2026
de6b103
Typos
caseyclements Feb 25, 2026
7e2a80d
Made _convert_raw_docs_to_proto staticmethods private
caseyclements Feb 25, 2026
8a82e74
After benchmarking two alogithm for conevrting read results from bson…
caseyclements Feb 25, 2026
f09faa0
Add extra unit tests
caseyclements Feb 25, 2026
0ba503c
Formatting
caseyclements Feb 25, 2026
6b96c0e
Fixes in pyproject.toml
caseyclements Feb 27, 2026
7c3874b
Fixed Detect secrets false positives.
caseyclements Mar 2, 2026
49022e3
Update sdk/python/feast/infra/online_stores/mongodb_online_store/mong…
caseyclements Mar 2, 2026
a2c493e
Fix CI: guard pymongo imports and skip test module when pymongo unava…
caseyclements Mar 3, 2026
dcb9072
Fix: return (None, None) when entity doc exists but feature view was …
caseyclements Mar 3, 2026
bcb63aa
Update pixi.lock after adding mongodb optional dependency to pyprojec…
caseyclements Mar 3, 2026
1cb84dc
fix: catch FeastExtrasDependencyImportError in doctest runner
caseyclements Mar 4, 2026
c02eebf
fix: update PYTEST_PLUGINS path for mongodb online store tests
caseyclements Mar 4, 2026
3eb6107
fix: broaden import exception handling in doctest runner to catch Typ…
caseyclements Mar 4, 2026
01d2e4c
fix: pass onerror to pkgutil.walk_packages to suppress non-ImportErro…
caseyclements Mar 4, 2026
156f17b
fix: update stale tests.integration.feature_repos imports to tests.un…
caseyclements Mar 4, 2026
762d17b
feat: add mongodb to ValidOnlineStoreDBStorePersistenceTypes in feast…
caseyclements Mar 5, 2026
6147c87
feat: add Feast driver metadata to MongoDB client instantiations
caseyclements Mar 5, 2026
1492a1e
docs: update MongoDB online store status from alpha to preview
caseyclements Mar 5, 2026
0d80772
fix: add mongodb to kubebuilder Enum annotations for OnlineStoreDBSto…
caseyclements Mar 5, 2026
7563f11
Update +GOLANGCI_LINT_VERSION to fix upstream issue golang/go#74462
caseyclements Mar 6, 2026
26ad3bb
fix: raise ValueError in _get_client_async for invalid config type, c…
caseyclements Mar 6, 2026
2f92af9
fix: Added mongodb to operator yamls
ntkathole Mar 9, 2026
577f2a7
Small change suggested by ntkathole
caseyclements Mar 9, 2026
e761e10
Factor out write logic into utility function making sync/async essent…
caseyclements Mar 9, 2026
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
Formatting
Signed-off-by: Casey Clements <casey.clements@mongodb.com>
  • Loading branch information
caseyclements committed Mar 10, 2026
commit a6db5c7727ab283ed3957e2dd61e805c7ad22d3a
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .mongodb import MongoDBOnlineStore, MongoDBOnlineStoreConfig

__all__ = ["MongoDBOnlineStore", "MongoDBOnlineStoreConfig"]
__all__ = ["MongoDBOnlineStore", "MongoDBOnlineStoreConfig"]
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
from feast.repo_config import FeastConfigBaseModel, RepoConfig
from feast.type_map import python_values_to_proto_values, feast_value_type_to_python_type

from feast.type_map import (
feast_value_type_to_python_type,
python_values_to_proto_values,
)

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -165,79 +167,6 @@ def online_read(
results.append((ts, features_proto))
return results

# todo v inefficient: the method below must infer types. additionally we're iterating over rows
# feature.dtype is held in table.feature.dtype.
"""
Feast’s online read is row-oriented in output, but type conversion is naturally column-oriented.
Instead of:
For each entity → convert each feature individually
You should:
1. Gather values for a single feature across all entities.
2. Convert them in one call.
3. Then reassemble row-wise.

Efficient Pattern
Assume:
• ids is ordered
• requested_features is defined (handle case)
• docs is your _id -> doc mapping
Step 1: Extract raw values column-wise


# Step 1: Extract raw values column-wise # (aligned by ordered ids column-wise)
raw_feature_columns = {feature: [] for feature in requested_features}

for entity_id in ids:
doc = docs.get(entity_id)
feature_dict = (
doc.get("features", {}).get(table.name, {})
if doc else {}
)

for feature in requested_features:
raw_feature_columns[feature].append(
feature_dict.get(feature)
)

# Step 2: Convert per feature
# You need feature types. We can get these from the table!
# The following will map feature.name to its value type. This is across columns
# features_raw contains the columns for a single row (entity)
# feature_type_map is done outside the entity loop
feature_type_map = {
feature.name: feature.dtype.to_value_type()
for feature in table.features
}
proto_feature_columns = {}
for feature_name, raw_values in raw_feature_columns.items():
proto_feature_columns[feature_name] = python_values_to_proto_values(
raw_values,
feature_type=feature_type_map[feature_name],
)

# Step 3: Reassemble row-wise
results = []

for i, entity_id in enumerate(ids):
doc = docs.get(entity_id)

if doc is None:
results.append((None, None))
continue

ts = doc.get("event_timestamps", {}).get(table.name)

row_features = {
feature_name: proto_feature_columns[feature_name][i]
for feature_name in requested_features
}

results.append((ts, row_features))

return results
"""
# ------------------------------------------------------------------

def update(
self,
config: RepoConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
import os
import platform
import random
import sqlite3
import sys
import time
from typing import Any

import numpy as np
import pandas as pd
import pytest
import sqlite_vec
from pandas.testing import assert_frame_equal

from feast import FeatureStore, RepoConfig
from feast.errors import FeatureViewNotFoundException
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import FloatList as FloatListProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
from feast.repo_config import RegistryConfig
from feast.torch_wrapper import get_torch
from feast.types import ValueType
from feast.utils import _utc_now
from tests.integration.feature_repos.universal.feature_views import TAGS
from tests.utils.cli_repo_creator import CliRunner, get_example_repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from feast.infra.online_stores.contrib.mongodb_online_store.mongodb import (
MongoDBOnlineStoreConfig,
)
from feast.infra.online_stores.sqlite import SqliteOnlineStoreConfig
from feast.on_demand_feature_view import on_demand_feature_view
from feast.types import Array, Float32, Float64, Int64, PdfBytes, String, ValueType
from tests.utils.test_wrappers import check_warnings
Expand Down