Visitar URL original
Removing changes on Aggregation · feast-dev/feast@2fda909 · GitHub
Skip to content

Commit 2fda909

Browse files
committed
Removing changes on Aggregation
Signed-off-by: Nick Quinn <nicholas_quinn@apple.com>
1 parent a97aa12 commit 2fda909

2 files changed

Lines changed: 3 additions & 26 deletions

File tree

‎sdk/python/feast/aggregation/__init__.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ def to_proto(self) -> AggregationProto:
6969
@classmethod
7070
def from_proto(cls, agg_proto: AggregationProto):
7171
time_window = (
72-
None
72+
timedelta(days=0)
7373
if agg_proto.time_window.ToNanoseconds() == 0
7474
else agg_proto.time_window.ToTimedelta()
7575
)
7676

7777
slide_interval = (
78-
None
78+
timedelta(days=0)
7979
if agg_proto.slide_interval.ToNanoseconds() == 0
8080
else agg_proto.slide_interval.ToTimedelta()
8181
)

‎sdk/python/tests/unit/test_on_demand_feature_view_input_schema.py‎

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import pytest
2222

2323
from feast import Entity, Field
24-
from feast.aggregation import Aggregation, aggregation_specs_to_agg_ops
24+
from feast.aggregation import Aggregation
2525
from feast.on_demand_feature_view import OnDemandFeatureView, on_demand_feature_view
2626
from feast.types import Float64, Int64
2727
from feast.value_type import ValueType
@@ -165,26 +165,3 @@ def dummy(df):
165165
schema=[Field(name="out", dtype=Float64)],
166166
udf=dummy,
167167
)
168-
169-
170-
def test_aggregation_from_proto_no_time_window_roundtrip():
171-
"""Aggregation.from_proto preserves None time_window (fixes timedelta(0) regression)."""
172-
agg = Aggregation(column="amount", function="sum", name="total_amount")
173-
assert agg.time_window is None
174-
175-
restored = Aggregation.from_proto(agg.to_proto())
176-
assert restored.time_window is None
177-
assert restored == agg
178-
179-
180-
def test_aggregation_from_proto_no_time_window_online_serving():
181-
"""Aggregations without time_window don't raise in aggregation_specs_to_agg_ops after roundtrip."""
182-
agg = Aggregation(column="amount", function="sum", name="total_amount")
183-
restored = Aggregation.from_proto(agg.to_proto())
184-
185-
# Should not raise — time_window is None, not timedelta(0)
186-
result = aggregation_specs_to_agg_ops(
187-
[restored],
188-
time_window_unsupported_error_message="Time window aggregation is not supported in online serving",
189-
)
190-
assert result == {"total_amount": ("sum", "amount")}

0 commit comments

Comments
 (0)