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

Update dependencies #1930

Merged
merged 4 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 1 addition & 15 deletions ehrql/query_engines/base_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,21 +553,7 @@ def get_sql_case(self, node):
default = self.get_expr(node.default)
else:
default = None
expr = sqlalchemy.case(*cases, else_=default)
# Temporary workaround for bug in SQLAlchemy. This can be removed when this PR
# is merged and released:
# https://github.com/sqlalchemy/sqlalchemy/pull/10847
expr.type = next(
# Find the type of the first non-null case value
(
value.type
for condition, value in expr.whens
if not isinstance(value.type, sqlalchemy.types.NullType)
),
# Use the type of the `else` clause if there are no matches above
expr.else_.type if expr.else_ is not None else sqlalchemy.types.NullType(),
)
return expr
return sqlalchemy.case(*cases, else_=default)

@get_sql.register(AggregateByPatient.Sum)
def get_sql_sum(self, node):
Expand Down
2 changes: 1 addition & 1 deletion ehrql/query_engines/sqlite_dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class SQLiteDialect(SQLiteDialect_pysqlite):
supports_statement_cache = True
supports_statement_cache = False

@classmethod
def import_dbapi(cls):
Expand Down