From 401a3f5e30c16b6cfb7b804ee067ed3754e345d6 Mon Sep 17 00:00:00 2001 From: JamieDeMaria Date: Thu, 22 Aug 2024 12:05:23 -0400 Subject: [PATCH] error sooner --- .../dagster/dagster/_core/storage/runs/sql_run_storage.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python_modules/dagster/dagster/_core/storage/runs/sql_run_storage.py b/python_modules/dagster/dagster/_core/storage/runs/sql_run_storage.py index 266d941dbedcb..b5b6a15370df5 100644 --- a/python_modules/dagster/dagster/_core/storage/runs/sql_run_storage.py +++ b/python_modules/dagster/dagster/_core/storage/runs/sql_run_storage.py @@ -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(