Repository navigation
Commit b20d2f6
saket3395
fix: feast apply ignores ttl updates when new ttl is None or timedelta(0)
Fixes feast-dev#6703. Registry._update_metadata_fields() routes ttl changes on
re-apply through a truthiness check:
if (... and updated_fv.ttl):
None and timedelta(0) are both the documented way to express "no
ttl", and both are falsy, so re-applying a FeatureView/LabelView with
ttl cleared silently kept the old finite ttl -- feast apply reported
the update but nothing changed in the registry.
Removing that outer truthy gate isn't sufficient by itself: for the
FeatureView branch, get_ttl_duration() returns Python None when
self.ttl is None, and the existing inner check
if ttl_duration:
existing_proto.spec.ttl.CopyFrom(ttl_duration)
would still silently skip CopyFrom in that case, leaving the stale
ttl in place. Fixed both by explicitly writing an empty Duration()
(which decodes back to timedelta(0), per FeatureView.from_proto's
existing ToNanoseconds()==0 check) whenever there's no real ttl to
write, instead of skipping the write.
The LabelView branch is adjusted the same way, guarding
FromTimedelta() against a None ttl now that the outer gate no longer
prevents ttl=None from reaching this branch.
Traced all three cases (None, timedelta(0), a finite value) through
the new branch logic in isolation and confirmed FeatureView and
LabelView now resolve identically: None and timedelta(0) both produce
a zero Duration, a finite ttl passes through unchanged.
Signed-off-by: saket3395 <[email protected]>1 parent a9219d9 commit b20d2f6
1 file changed
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
588 | 590 | | |
589 | 591 | | |
590 | | - | |
591 | | - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
592 | 595 | | |
593 | | - | |
594 | | - | |
595 | 596 | | |
596 | | - | |
| 597 | + | |
| 598 | + | |
597 | 599 | | |
598 | 600 | | |
599 | 601 | | |
| |||
0 commit comments