Differential D4761 Diff 23634 python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_partition_sets.py
Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_partition_sets.py
from collections import OrderedDict | from collections import OrderedDict | ||||
from dagster_graphql.client.query import LAUNCH_PARTITION_BACKFILL_MUTATION | from dagster_graphql.client.query import LAUNCH_PARTITION_BACKFILL_MUTATION | ||||
from dagster_graphql.test.utils import ( | from dagster_graphql.test.utils import ( | ||||
execute_dagster_graphql, | execute_dagster_graphql, | ||||
execute_dagster_graphql_and_finish_runs, | execute_dagster_graphql_and_finish_runs, | ||||
infer_repository_selector, | infer_repository_selector, | ||||
) | ) | ||||
from .graphql_context_test_suite import ( | from .graphql_context_test_suite import ( | ||||
ExecutingGraphQLContextTestMatrix, | OutOfProcessExecutingGraphQLContextTestMatrix, | ||||
ReadonlyGraphQLContextTestMatrix, | PersistentReadonlyGraphQLContextTestMatrix, | ||||
) | ) | ||||
GET_PARTITION_SETS_FOR_PIPELINE_QUERY = """ | GET_PARTITION_SETS_FOR_PIPELINE_QUERY = """ | ||||
query PartitionSetsQuery($repositorySelector: RepositorySelector!, $pipelineName: String!) { | query PartitionSetsQuery($repositorySelector: RepositorySelector!, $pipelineName: String!) { | ||||
partitionSetsOrError(repositorySelector: $repositorySelector, pipelineName: $pipelineName) { | partitionSetsOrError(repositorySelector: $repositorySelector, pipelineName: $pipelineName) { | ||||
__typename | __typename | ||||
...on PartitionSets { | ...on PartitionSets { | ||||
results { | results { | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | query PartitionSetQuery($repositorySelector: RepositorySelector!, $partitionSetName: String!) { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
""" | """ | ||||
class TestPartitionSets(ReadonlyGraphQLContextTestMatrix): | class TestPartitionSets(PersistentReadonlyGraphQLContextTestMatrix): | ||||
def test_get_partition_sets_for_pipeline(self, graphql_context, snapshot): | def test_get_partition_sets_for_pipeline(self, graphql_context, snapshot): | ||||
selector = infer_repository_selector(graphql_context) | selector = infer_repository_selector(graphql_context) | ||||
result = execute_dagster_graphql( | result = execute_dagster_graphql( | ||||
graphql_context, | graphql_context, | ||||
GET_PARTITION_SETS_FOR_PIPELINE_QUERY, | GET_PARTITION_SETS_FOR_PIPELINE_QUERY, | ||||
variables={"repositorySelector": selector, "pipelineName": "no_config_pipeline"}, | variables={"repositorySelector": selector, "pipelineName": "no_config_pipeline"}, | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | def test_get_partition_tags(self, graphql_context): | ||||
tags = OrderedDict({item["key"]: item["value"] for item in sorted_items}) | tags = OrderedDict({item["key"]: item["value"] for item in sorted_items}) | ||||
assert tags == { | assert tags == { | ||||
"foo": "0", | "foo": "0", | ||||
"dagster/partition": "0", | "dagster/partition": "0", | ||||
"dagster/partition_set": "integer_partition", | "dagster/partition_set": "integer_partition", | ||||
} | } | ||||
class TestPartitionSetRuns(ExecutingGraphQLContextTestMatrix): | class TestPartitionSetRuns(OutOfProcessExecutingGraphQLContextTestMatrix): | ||||
def test_get_partition_runs(self, graphql_context): | def test_get_partition_runs(self, graphql_context): | ||||
repository_selector = infer_repository_selector(graphql_context) | repository_selector = infer_repository_selector(graphql_context) | ||||
result = execute_dagster_graphql_and_finish_runs( | result = execute_dagster_graphql_and_finish_runs( | ||||
graphql_context, | graphql_context, | ||||
LAUNCH_PARTITION_BACKFILL_MUTATION, | LAUNCH_PARTITION_BACKFILL_MUTATION, | ||||
variables={ | variables={ | ||||
"backfillParams": { | "backfillParams": { | ||||
"selector": { | "selector": { | ||||
Show All 30 Lines |