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

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
Bobby Noelte
2026-03-08 21:04:22 +01:00
committed by GitHub
parent 997e7646e9
commit 1832364d60
4 changed files with 9 additions and 5 deletions

View File

@@ -6,7 +6,7 @@
# the root directory (no add-on folder as usual).
name: "Akkudoktor-EOS"
version: "0.2.0.dev2603032000228213"
version: "0.2.0.dev2603071785688456"
slug: "eos"
description: "Akkudoktor-EOS add-on"
url: "https://github.com/Akkudoktor-EOS/EOS"

View File

@@ -1,6 +1,6 @@
# Akkudoktor-EOS
**Version**: `v0.2.0.dev2603032000228213`
**Version**: `v0.2.0.dev2603071785688456`
<!-- pyml disable line-length -->
**Description**: This project provides a comprehensive solution for simulating and optimizing an energy system based on renewable energy sources. With a focus on photovoltaic (PV) systems, battery storage (batteries), load management (consumer requirements), heat pumps, electric vehicles, and consideration of electricity price data, this system enables forecasting and optimization of energy flow and costs over a specified period.

View File

@@ -8,7 +8,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "v0.2.0.dev2603032000228213"
"version": "v0.2.0.dev2603071785688456"
},
"paths": {
"/v1/admin/cache/clear": {

View File

@@ -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