Skip to content

Commit

Permalink
Defer guards on QueryBuilder distinct vs. group_by to make them useful.
Browse files Browse the repository at this point in the history
  • Loading branch information
TallJimbo committed Apr 4, 2024
1 parent 2b5ad6a commit 30b8449
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions python/lsst/daf/butler/direct_query_driver/_query_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ class QueryBuilder:
queries that have no real columns.
"""

def __post_init__(self) -> None:
assert not (self.distinct and self.group_by), "At most one of distinct and group_by can be set."

@classmethod
def handle_empty_columns(
cls, columns: list[sqlalchemy.sql.ColumnElement]
Expand Down Expand Up @@ -139,6 +136,7 @@ def select(self) -> sqlalchemy.Select:
select : `sqlalchemy.Select`
SQLAlchemy SELECT statement.
"""
assert not (self.distinct and self.group_by), "At most one of distinct and group_by can be set."
if self.joiner.name_shrinker is None:
self.joiner.name_shrinker = self.joiner._make_name_shrinker()
sql_columns: list[sqlalchemy.ColumnElement[Any]] = []
Expand Down

0 comments on commit 30b8449

Please sign in to comment.