Skip to content

Commit

Permalink
use an anonymous value to reduce sqlalchemy overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Apr 28, 2022
1 parent d68e5ca commit ce2231d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/recorder/purge.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _generate_find_attr_lambda() -> StatementLambdaElement:
return lambda_stmt(
lambda: union_all(
*[
select(func.min(States.attributes_id).label("id")).where(
select(func.min(States.attributes_id)).where(
States.attributes_id == bindparam(f"a{idx}", required=False)
)
for idx in range(
Expand Down
2 changes: 1 addition & 1 deletion tests/components/recorder/test_purge.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _generate_sqlite_compatible_find_attr_lambda() -> StatementLambdaElement:
return lambda_stmt(
lambda: union_all(
*[
select(func.min(States.attributes_id).label("id")).where(
select(func.min(States.attributes_id)).where(
States.attributes_id == bindparam(f"a{idx}", required=False)
)
for idx in range(
Expand Down

0 comments on commit ce2231d

Please sign in to comment.