diff --git a/js_modules/dagster-ui/packages/ui-core/src/graphql/schema.graphql b/js_modules/dagster-ui/packages/ui-core/src/graphql/schema.graphql index 21aef663b61ec..2736a25369d45 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/graphql/schema.graphql +++ b/js_modules/dagster-ui/packages/ui-core/src/graphql/schema.graphql @@ -2397,7 +2397,7 @@ enum AssetEventType { } input BulkActionsFilter { - status: [BulkActionStatus!] + status: BulkActionStatus createdBefore: Float createdAfter: Float } diff --git a/js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts b/js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts index 801c9323f11a3..f0c9c97d8b034 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts @@ -733,7 +733,7 @@ export enum BulkActionStatus { export type BulkActionsFilter = { createdAfter?: InputMaybe; createdBefore?: InputMaybe; - status?: InputMaybe>; + status?: InputMaybe; }; export type CancelBackfillResult = CancelBackfillSuccess | PythonError | UnauthorizedError; @@ -6984,7 +6984,10 @@ export const buildBulkActionsFilter = ( overrides && overrides.hasOwnProperty('createdAfter') ? overrides.createdAfter! : 6.09, createdBefore: overrides && overrides.hasOwnProperty('createdBefore') ? overrides.createdBefore! : 1.5, - status: overrides && overrides.hasOwnProperty('status') ? overrides.status! : [], + status: + overrides && overrides.hasOwnProperty('status') + ? overrides.status! + : BulkActionStatus.CANCELED, }; }; diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/inputs.py b/python_modules/dagster-graphql/dagster_graphql/schema/inputs.py index 7c6398de07a20..eb3834f91c9d2 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/inputs.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/inputs.py @@ -379,9 +379,7 @@ class Meta: class GrapheneBulkActionsFilter(graphene.InputObjectType): - status = graphene.List( - graphene.NonNull("dagster_graphql.schema.backfill.GrapheneBulkActionStatus") - ) + status = graphene.InputField("dagster_graphql.schema.backfill.GrapheneBulkActionStatus") createdBefore = graphene.InputField(graphene.Float) createdAfter = graphene.InputField(graphene.Float) @@ -390,11 +388,7 @@ class Meta: name = "BulkActionsFilter" def to_selector(self): - if self.status: - status = BulkActionStatus.from_graphql_input(self.status) - else: - status = None - + status = BulkActionStatus[self.status.value] if self.status else None created_before = datetime_from_timestamp(self.createdBefore) if self.createdBefore else None created_after = datetime_from_timestamp(self.createdAfter) if self.createdAfter else None diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_asset_backfill.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_asset_backfill.py index aaf5014daf5ec..ad6591dc4361a 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_asset_backfill.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_asset_backfill.py @@ -1176,7 +1176,6 @@ def test_get_backfills_with_filters(): backfill = instance.get_backfill(backfill_id) all_backfills.append(backfill) - # on PartitionBackfills get_backfills_result = execute_dagster_graphql( context, BACKFILLS_WITH_FILTERS_QUERY, @@ -1200,3 +1199,9 @@ def test_get_backfills_with_filters(): for result in backfill_results: assert result["timestamp"] > all_backfills[3].backfill_timestamp + + get_backfills_result = execute_dagster_graphql( + context, + BACKFILLS_WITH_FILTERS_QUERY, + variables={"filters": {"status": "REQUESTED"}}, + )