From 3c90ea0a2528139ed5485f2b43564f16d49cc717 Mon Sep 17 00:00:00 2001 From: "David H. Irving" Date: Thu, 28 Dec 2023 13:07:21 -0700 Subject: [PATCH] Fix mypy error These are logically two different variables, but the name was previously being re-used. --- .../lsst/daf/butler/registry/queries/butler_sql_engine.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/lsst/daf/butler/registry/queries/butler_sql_engine.py b/python/lsst/daf/butler/registry/queries/butler_sql_engine.py index ffecd48149..9e2d733fd1 100644 --- a/python/lsst/daf/butler/registry/queries/butler_sql_engine.py +++ b/python/lsst/daf/butler/registry/queries/butler_sql_engine.py @@ -192,13 +192,13 @@ def to_payload(self, relation: Relation) -> sql.Payload[LogicalColumn]: # aside from the special 'rownum' window-function column). search_columns = self.extract_mapping(target.columns, search.columns) partition_by = [search_columns[tag] for tag in operation.dimensions] - rownum_column = sqlalchemy.sql.func.row_number() + row_number = sqlalchemy.sql.func.row_number() if partition_by: - rownum_column = rownum_column.over( + rownum_column = row_number.over( partition_by=partition_by, order_by=search_columns[operation.rank] ) else: - rownum_column = rownum_column.over(order_by=search_columns[operation.rank]) + rownum_column = row_number.over(order_by=search_columns[operation.rank]) window = self.select_items( search_columns.items(), search, rownum_column.label("rownum") ).subquery(f"{operation.rank.dataset_type}_window")