fix: coerce datetime conversion errors (#32683)

This commit is contained in:
Beto Dealmeida
2025-03-18 13:09:23 -04:00
committed by GitHub
parent a2c164a77d
commit 99e69c32ee
3 changed files with 204 additions and 8 deletions

View File

@@ -483,8 +483,3 @@ class TestUtils(SupersetTestCase):
# test numeric epoch_ms format
df = pd.DataFrame([{"__timestamp": ts.timestamp() * 1000, "a": 1}])
assert normalize_col(df, "epoch_ms", 0, None)[DTTM_ALIAS][0] == ts
# test that we raise an error when we can't convert
df = pd.DataFrame([{"__timestamp": "1677-09-21 00:00:00", "a": 1}])
with pytest.raises(pd.errors.OutOfBoundsDatetime):
normalize_col(df, None, 0, None)