From 75c1ac99b7c16e829253209df6c331ef7eabd79a Mon Sep 17 00:00:00 2001 From: Johann Miller Date: Mon, 16 Oct 2023 14:48:40 -0400 Subject: [PATCH] cover [] and none --- .../dagster_graphql/test/utils.py | 6 +++-- .../graphql/test_execute_pipeline.py | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/python_modules/dagster-graphql/dagster_graphql/test/utils.py b/python_modules/dagster-graphql/dagster_graphql/test/utils.py index 874ae986fe271..6b7bd62153359 100644 --- a/python_modules/dagster-graphql/dagster_graphql/test/utils.py +++ b/python_modules/dagster-graphql/dagster_graphql/test/utils.py @@ -195,14 +195,16 @@ def infer_pipeline_selector( graphql_context: WorkspaceRequestContext, pipeline_name: str, op_selection: Optional[Sequence[str]] = None, + asset_selection: Optional[Sequence[GqlAssetKey]] = None, + asset_check_selection: Optional[Sequence[GqlAssetCheckHandle]] = None, ) -> Selector: selector = infer_repository_selector(graphql_context) selector.update( { "pipelineName": pipeline_name, "solidSelection": op_selection, - "assetSelection": [], - "assetCheckSelection": [], + "assetSelection": asset_selection, + "assetCheckSelection": asset_check_selection, } ) return selector diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_execute_pipeline.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_execute_pipeline.py index 57a519c1394d6..cee22cb9b8674 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_execute_pipeline.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_execute_pipeline.py @@ -687,6 +687,33 @@ def test_nested_graph_op_selection_and_config(self, graphql_context: WorkspaceRe assert step_did_not_run(logs, "plus_one") assert step_did_not_run(logs, "subgraph.op_2") + def test_nested_graph_op_selection_and_config_with_non_null_asset_and_check_selection( + self, graphql_context: WorkspaceRequestContext + ): + selector = infer_pipeline_selector( + graphql_context, + "nested_job", + ["subgraph.adder", "subgraph.op_1"], + asset_selection=[], + asset_check_selection=[], + ) + run_config = {"ops": {"subgraph": {"ops": {"adder": {"inputs": {"num2": 20}}}}}} + result = sync_execute_get_run_log_data( + context=graphql_context, + variables={ + "executionParams": { + "selector": selector, + "runConfigData": run_config, + } + }, + ) + logs = result["messages"] + assert isinstance(logs, list) + assert step_did_succeed(logs, "subgraph.adder") + assert step_did_succeed(logs, "subgraph.op_1") + assert step_did_not_run(logs, "plus_one") + assert step_did_not_run(logs, "subgraph.op_2") + def test_memoization_job(self, graphql_context: WorkspaceRequestContext): selector = infer_pipeline_selector(graphql_context, "memoization_job") run_config = {}