Skip to content

Commit

Permalink
Merge pull request #1930 from opensafely-core/evansd/update-deps
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
evansd committed Feb 28, 2024
2 parents 8657870 + 58b8561 commit 27fa496
Show file tree
Hide file tree
Showing 4 changed files with 612 additions and 612 deletions.
16 changes: 1 addition & 15 deletions ehrql/query_engines/base_sql.py
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
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

0 comments on commit 27fa496

Please sign in to comment.