Skip to content

Commit 117d0b7

Browse files
committed
Fixes OPEN-5188 Publish batch data timestamp weirdness
1 parent ee4518b commit 117d0b7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

openlayer/validators/dataset_validators.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,10 @@ def _timestamps_within_valid_range(
270270
) -> bool:
271271
"""Checks whether the timestamps are within the allowed range."""
272272
# Note the unit="s" argument
273-
timestamps = pd.to_datetime(dataset_df[timestamp_column_name], unit="s")
274-
now = pd.Timestamp.now()
273+
timestamps = pd.to_datetime(
274+
dataset_df[timestamp_column_name], utc=True, unit="s"
275+
)
276+
now = pd.Timestamp.utcnow()
275277
two_years_ago = now - pd.Timedelta(days=365 * 2)
276278
two_years_from_now = now + pd.Timedelta(days=365 * 2)
277279
if any(

openlayer/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
data=data,
2323
)
2424
"""
25-
__version__ = "0.1.0a14"
25+
__version__ = "0.1.0a15"

0 commit comments

Comments
 (0)