Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rollback on exception that needs rollback in SQL #104948

Merged
merged 4 commits into from
Dec 8, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions homeassistant/components/sql/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@
self._query,
redact_credentials(str(err)),
)
sess.rollback()
sess.close()

Check warning on line 366 in homeassistant/components/sql/sensor.py

View check run for this annotation

Codecov / codecov/patch

homeassistant/components/sql/sensor.py#L366

Added line #L366 was not covered by tests
return

for res in result.mappings():
Expand Down