Skip to content

Commit

Permalink
error sooner
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Aug 22, 2024
1 parent a2f313a commit 401a3f5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -841,11 +841,11 @@ def get_backfills(
) -> Sequence[PartitionBackfill]:
check.opt_inst_param(status, "status", BulkActionStatus)
query = db_select([BulkActionsTable.c.body, BulkActionsTable.c.timestamp])
if status and filters:
raise DagsterInvariantViolationError(
"Cannot provide status and filters to get_backfills. Please use filters rather than status."
)
if status or (filters and filters.statuses):
if status and filters and filters.statuses:
raise DagsterInvariantViolationError(
"Conflicting status filters provided to get_backfills. Choose one of status or BulkActionsFilter.statuses."
)
statuses = [status] if status else (filters.statuses if filters else None)
assert statuses
query = query.where(
Expand Down

0 comments on commit 401a3f5

Please sign in to comment.