Visitar URL original
feat: Optional input_schema for ODFV (#6308) by nquinn408 · Pull Request #6312 · feast-dev/feast · GitHub
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
Removing changes on Aggregation
Signed-off-by: Nick Quinn <nicholas_quinn@apple.com>
  • Loading branch information
nickquinn408 committed Apr 22, 2026
commit 49bc6685e3c6e8543fc4e61ccfa06579b0a58796
4 changes: 2 additions & 2 deletions sdk/python/feast/aggregation/__init__.py
Comment thread
nquinn408 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ def to_proto(self) -> AggregationProto:
@classmethod
def from_proto(cls, agg_proto: AggregationProto):
time_window = (
None
timedelta(days=0)
if agg_proto.time_window.ToNanoseconds() == 0
else agg_proto.time_window.ToTimedelta()
)

slide_interval = (
None
timedelta(days=0)
if agg_proto.slide_interval.ToNanoseconds() == 0
else agg_proto.slide_interval.ToTimedelta()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import pytest

from feast import Entity, Field
from feast.aggregation import Aggregation, aggregation_specs_to_agg_ops
from feast.aggregation import Aggregation
from feast.on_demand_feature_view import OnDemandFeatureView, on_demand_feature_view
from feast.types import Float64, Int64
from feast.value_type import ValueType
Expand Down Expand Up @@ -165,26 +165,3 @@ def dummy(df):
schema=[Field(name="out", dtype=Float64)],
udf=dummy,
)


def test_aggregation_from_proto_no_time_window_roundtrip():
"""Aggregation.from_proto preserves None time_window (fixes timedelta(0) regression)."""
agg = Aggregation(column="amount", function="sum", name="total_amount")
assert agg.time_window is None

restored = Aggregation.from_proto(agg.to_proto())
assert restored.time_window is None
assert restored == agg


def test_aggregation_from_proto_no_time_window_online_serving():
"""Aggregations without time_window don't raise in aggregation_specs_to_agg_ops after roundtrip."""
agg = Aggregation(column="amount", function="sum", name="total_amount")
restored = Aggregation.from_proto(agg.to_proto())

# Should not raise — time_window is None, not timedelta(0)
result = aggregation_specs_to_agg_ops(
[restored],
time_window_unsupported_error_message="Time window aggregation is not supported in online serving",
)
assert result == {"total_amount": ("sum", "amount")}