Skip to content

Commit

Permalink
Fix mypy error
Browse files Browse the repository at this point in the history
These are logically two different variables, but the name was previously being re-used.
  • Loading branch information
dhirving committed Dec 28, 2023
1 parent 747d2cb commit 3c90ea0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/lsst/daf/butler/registry/queries/butler_sql_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 3c90ea0

Please sign in to comment.