Always use UTC time for the MariaDB/MySQL session#87583
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
6e18ea4 to
21a1944
Compare
|
I wanted to tag this for a patch release as I think it will solve some unexplained issues but I'm a bit nervous about it as I don't have a large enough test surface to feel 100% on it. |
|
Uncovered lines are the postgresql and mysql test runners which don't currently report to codecov |
|
According to coverage postgre and mariadb should upload their coverage |
|
Something isn't seeing them because its running the same test on sqlite / mariadb / postgresql and those lines are covered for sqlite but its reporting them as covered for mariadb/postgresql. I'm not sure whats going on but hopefully we can sort it out in #87640 |
|
I'm pretty sure it's a temporary error from codecov. I don't think #87640 will change anything here. |
That's not the case, the migration tests were hard coded to use an sqlite database, that was fixed by #87753 |
emontnemery
left a comment
There was a problem hiding this comment.
LGTM, thanks @bdraco 👍
Proposed change
Currently the MariaDB/MySQL session uses the default global time zone and we convert
all times to UTC via
process_timestamphttps://github.com/home-assistant/core/blob/dev/homeassistant/components/recorder/models.py#L85This behavior leads to incorrect results during daylight savings time
since there are multiple possible times that resolve to the same UTC timestamp.
By setting the session up as UTC time we avoid the double conversion
process_timestampconversion that was done in python to get the time zone back to UTC.Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: