mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-03-15 02:56:17 +00:00
fix: pydantic datetime dataframe timezone conversion (#927)
Some checks failed
Close stale pull requests/issues / Find Stale issues and PRs (push) Has been cancelled
Bump Version / Bump Version Workflow (push) Has been cancelled
docker-build / platform-excludes (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Run Pytest on Pull Request / test (push) Has been cancelled
docker-build / build (push) Has been cancelled
docker-build / merge (push) Has been cancelled
Some checks failed
Close stale pull requests/issues / Find Stale issues and PRs (push) Has been cancelled
Bump Version / Bump Version Workflow (push) Has been cancelled
docker-build / platform-excludes (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Run Pytest on Pull Request / test (push) Has been cancelled
docker-build / build (push) Has been cancelled
docker-build / merge (push) Has been cancelled
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
@@ -1136,9 +1136,13 @@ class PydanticDateTimeDataFrame(PydanticBaseModel):
|
||||
data_tz = cls._detect_data_tz(df)
|
||||
|
||||
if tz is not None:
|
||||
if data_tz and data_tz != tz:
|
||||
raise ValueError(f"Timezone mismatch: tz='{tz}' but data uses '{data_tz}'")
|
||||
resolved_tz = tz
|
||||
if data_tz and data_tz != tz:
|
||||
warning_msg = (
|
||||
f"Forcing Pydantic dataframe timezone to '{resolved_tz}' - "
|
||||
f"data timezone was '{data_tz}'."
|
||||
)
|
||||
logger.warning(warning_msg)
|
||||
else:
|
||||
if data_tz:
|
||||
resolved_tz = data_tz
|
||||
|
||||
Reference in New Issue
Block a user