Skip to content

Commit

Permalink
Validate datetimes in materialize in correct order (#1456)
Browse files Browse the repository at this point in the history
* Validate datetimes in materialize in correct order

Signed-off-by: Jacob Klegar <[email protected]>

* make tzaware

Signed-off-by: Jacob Klegar <[email protected]>
  • Loading branch information
jklegar authored Apr 13, 2021
1 parent 7b4c3ba commit 74ff628
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import pandas as pd

from feast import utils
from feast.entity import Entity
from feast.feature_view import FeatureView
from feast.infra.provider import Provider, RetrievalJob, get_provider
Expand Down Expand Up @@ -368,6 +369,11 @@ def materialize(
"""
self._tele.log("materialize")

if utils.make_tzaware(start_date) > utils.make_tzaware(end_date):
raise ValueError(
f"The given start_date {start_date} is greater than the given end_date {end_date}."
)

feature_views_to_materialize = []
if feature_views is None:
feature_views_to_materialize = self._registry.list_feature_views(
Expand Down

0 comments on commit 74ff628

Please sign in to comment.