Repository navigation
Commit 1bd6944
fix: Preserve an unset aggregation time window across a proto round-trip
Aggregation.__init__ types time_window and slide_interval as Optional and
to_proto honours that: it only writes the Duration when the value is not
None. from_proto tests the value instead of the presence, and an absent
Duration also reports ToNanoseconds() == 0, so an aggregation defined
without a window comes back with timedelta(0).
That difference is load bearing. aggregation_specs_to_agg_ops rejects a
windowed aggregation in online serving with 'if getattr(agg,
"time_window", None) is not None', so an on demand feature view with a
plain Aggregation(column=..., function=...) works in process and then
fails with 'Time window aggregation is not supported in online serving.'
on the first get_online_features after feast apply, whatever the
registry. The same round-trip runs for StreamFeatureView.
Read the field through HasField, which is available because both are
google.protobuf.Duration message fields. Aggregation.__eq__ compares
these two attributes, so this also stops a registry diff from seeing an
unchanged feature view as modified.
Signed-off-by: Rodrigo-Palma <email.rodrigopalma@gmail.com>1 parent 139704f commit 1bd6944
2 files changed
Lines changed: 48 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
0 commit comments