Skip to content

Commit f756730

Browse files
committed
just make online_store_ttl an int rather than timedelta
1 parent b45fa35 commit f756730

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sdk/python/feast/feature_view.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,18 +496,18 @@ def most_recent_end_time(self) -> Optional[datetime]:
496496
return max([interval[1] for interval in self.materialization_intervals])
497497

498498
@property
499-
def online_store_ttl(self) -> Optional[timedelta]:
499+
def online_store_ttl(self) -> Optional[int]:
500500
"""
501501
Retrieves the online store TTL from the FeatureView's tags.
502502
503503
Returns:
504-
A timedelta representing the TTL, or None if not set.
504+
An integer representing the TTL in seconds, or None if not set.
505505
"""
506506
ttl_str = self.tags.get("online_store_ttl")
507507
if ttl_str:
508508
try:
509509
ttl_seconds = int(ttl_str)
510-
return timedelta(seconds=ttl_seconds)
510+
return ttl_seconds
511511
except ValueError:
512512
raise ValueError(
513513
f"Invalid online_store_ttl value '{ttl_str}' in tags. It must be an integer representing seconds."

sdk/python/feast/infra/online_stores/contrib/cassandra_online_store/cassandra_online_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,8 @@ def _create_table(self, config: RepoConfig, project: str, table: FeatureView):
572572
fqtable = CassandraOnlineStore._fq_table_name(keyspace, project, table)
573573

574574
ttl = (
575-
int(table.online_store_ttl.total_seconds())
576-
if table.online_store_ttl
575+
table.online_store_ttl
576+
if table.online_store_ttl is not None
577577
else config.online_store.ttl
578578
)
579579
table_options = f" AND default_time_to_live = {ttl}" if ttl is not None else ""

0 commit comments

Comments
 (0)