diff --git a/python_modules/dagster-graphql/dagster_graphql/test/utils.py b/python_modules/dagster-graphql/dagster_graphql/test/utils.py index 27a051ea6de7a..cb52d1c34c646 100644 --- a/python_modules/dagster-graphql/dagster_graphql/test/utils.py +++ b/python_modules/dagster-graphql/dagster_graphql/test/utils.py @@ -165,7 +165,7 @@ def infer_repository(graphql_context: WorkspaceRequestContext) -> RemoteReposito assert len(repositories) == 1 return next(iter(repositories.values())) - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) return code_location.get_repository("test_repo") @@ -177,7 +177,7 @@ def infer_repository_selector(graphql_context: WorkspaceRequestContext) -> Selec assert len(repositories) == 1 repository = next(iter(repositories.values())) else: - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") return { diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_reload_repository_location.py b/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_reload_repository_location.py index 1fa645a7f2174..0eecd4e5a4bc8 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_reload_repository_location.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_reload_repository_location.py @@ -2,6 +2,7 @@ import pytest from dagster_graphql import DagsterGraphQLClientError, ReloadRepositoryLocationStatus +from dagster_graphql.test.utils import main_repo_location_name from dagster_graphql_tests.client_tests.conftest import MockClient, python_client_test_suite from dagster_graphql_tests.graphql.graphql_context_test_suite import ( @@ -96,6 +97,6 @@ def test_failure_with_query_error(mock_client: MockClient): class TestReloadRepositoryLocationWithClient(BaseTestSuite): def test_reload_location_real(self, graphql_client): assert ( - graphql_client.reload_repository_location("test").status + graphql_client.reload_repository_location(main_repo_location_name()).status == ReloadRepositoryLocationStatus.SUCCESS ) diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_shutdown_repository_location.py b/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_shutdown_repository_location.py index aab0b1cf8f769..94caba8239772 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_shutdown_repository_location.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/client_tests/test_shutdown_repository_location.py @@ -4,7 +4,7 @@ from dagster._core.errors import DagsterUserCodeUnreachableError from dagster_graphql import ShutdownRepositoryLocationStatus from dagster_graphql.client.client_queries import SHUTDOWN_REPOSITORY_LOCATION_MUTATION -from dagster_graphql.test.utils import execute_dagster_graphql +from dagster_graphql.test.utils import execute_dagster_graphql, main_repo_location_name from dagster_graphql_tests.graphql.graphql_context_test_suite import ( GraphQLContextVariant, @@ -22,7 +22,7 @@ def test_shutdown_repository_location_permission_failure(self, graphql_context): result = execute_dagster_graphql( graphql_context, SHUTDOWN_REPOSITORY_LOCATION_MUTATION, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -36,7 +36,7 @@ def test_shutdown_repository_location(self, graphql_client, graphql_context): origin = next(iter(graphql_context.get_code_location_entries().values())).origin origin.create_client().heartbeat() - result = graphql_client.shutdown_repository_location("test") + result = graphql_client.shutdown_repository_location(main_repo_location_name()) assert result.status == ShutdownRepositoryLocationStatus.SUCCESS, result.message diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/__snapshots__/test_assets.ambr b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/__snapshots__/test_assets.ambr index 6e59d4895372a..e4613783e7ada 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/__snapshots__/test_assets.ambr +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/__snapshots__/test_assets.ambr @@ -14,7 +14,7 @@ }), }), dict({ - 'id': 'test.test_repo.["asset_1"]', + 'id': 'test_location.test_repo.["asset_1"]', 'key': dict({ 'path': list([ 'asset_1', @@ -22,7 +22,7 @@ }), }), dict({ - 'id': 'test.test_repo.["asset_2"]', + 'id': 'test_location.test_repo.["asset_2"]', 'key': dict({ 'path': list([ 'asset_2', @@ -30,7 +30,7 @@ }), }), dict({ - 'id': 'test.test_repo.["asset_3"]', + 'id': 'test_location.test_repo.["asset_3"]', 'key': dict({ 'path': list([ 'asset_3', @@ -38,7 +38,7 @@ }), }), dict({ - 'id': 'test.test_repo.["asset_one"]', + 'id': 'test_location.test_repo.["asset_one"]', 'key': dict({ 'path': list([ 'asset_one', @@ -46,7 +46,7 @@ }), }), dict({ - 'id': 'test.test_repo.["asset_two"]', + 'id': 'test_location.test_repo.["asset_two"]', 'key': dict({ 'path': list([ 'asset_two', @@ -54,7 +54,7 @@ }), }), dict({ - 'id': 'test.test_repo.["asset_with_automation_condition"]', + 'id': 'test_location.test_repo.["asset_with_automation_condition"]', 'key': dict({ 'path': list([ 'asset_with_automation_condition', @@ -62,7 +62,7 @@ }), }), dict({ - 'id': 'test.test_repo.["asset_with_custom_automation_condition"]', + 'id': 'test_location.test_repo.["asset_with_custom_automation_condition"]', 'key': dict({ 'path': list([ 'asset_with_custom_automation_condition', @@ -70,7 +70,7 @@ }), }), dict({ - 'id': 'test.test_repo.["asset_yields_observation"]', + 'id': 'test_location.test_repo.["asset_yields_observation"]', 'key': dict({ 'path': list([ 'asset_yields_observation', @@ -86,7 +86,7 @@ }), }), dict({ - 'id': 'test.test_repo.["bar"]', + 'id': 'test_location.test_repo.["bar"]', 'key': dict({ 'path': list([ 'bar', @@ -94,7 +94,7 @@ }), }), dict({ - 'id': 'test.test_repo.["baz"]', + 'id': 'test_location.test_repo.["baz"]', 'key': dict({ 'path': list([ 'baz', @@ -110,7 +110,7 @@ }), }), dict({ - 'id': 'test.test_repo.["check_in_op_asset"]', + 'id': 'test_location.test_repo.["check_in_op_asset"]', 'key': dict({ 'path': list([ 'check_in_op_asset', @@ -118,7 +118,7 @@ }), }), dict({ - 'id': 'test.test_repo.["diamond_source"]', + 'id': 'test_location.test_repo.["diamond_source"]', 'key': dict({ 'path': list([ 'diamond_source', @@ -126,7 +126,7 @@ }), }), dict({ - 'id': 'test.test_repo.["downstream_asset"]', + 'id': 'test_location.test_repo.["downstream_asset"]', 'key': dict({ 'path': list([ 'downstream_asset', @@ -134,7 +134,7 @@ }), }), dict({ - 'id': 'test.test_repo.["downstream_dynamic_partitioned_asset"]', + 'id': 'test_location.test_repo.["downstream_dynamic_partitioned_asset"]', 'key': dict({ 'path': list([ 'downstream_dynamic_partitioned_asset', @@ -142,7 +142,7 @@ }), }), dict({ - 'id': 'test.test_repo.["downstream_static_partitioned_asset"]', + 'id': 'test_location.test_repo.["downstream_static_partitioned_asset"]', 'key': dict({ 'path': list([ 'downstream_static_partitioned_asset', @@ -150,7 +150,7 @@ }), }), dict({ - 'id': 'test.test_repo.["downstream_time_partitioned_asset"]', + 'id': 'test_location.test_repo.["downstream_time_partitioned_asset"]', 'key': dict({ 'path': list([ 'downstream_time_partitioned_asset', @@ -158,7 +158,7 @@ }), }), dict({ - 'id': 'test.test_repo.["downstream_weekly_partitioned_asset"]', + 'id': 'test_location.test_repo.["downstream_weekly_partitioned_asset"]', 'key': dict({ 'path': list([ 'downstream_weekly_partitioned_asset', @@ -166,7 +166,7 @@ }), }), dict({ - 'id': 'test.test_repo.["dummy_source_asset"]', + 'id': 'test_location.test_repo.["dummy_source_asset"]', 'key': dict({ 'path': list([ 'dummy_source_asset', @@ -174,7 +174,7 @@ }), }), dict({ - 'id': 'test.test_repo.["dynamic_in_multipartitions_fail"]', + 'id': 'test_location.test_repo.["dynamic_in_multipartitions_fail"]', 'key': dict({ 'path': list([ 'dynamic_in_multipartitions_fail', @@ -182,7 +182,7 @@ }), }), dict({ - 'id': 'test.test_repo.["dynamic_in_multipartitions_success"]', + 'id': 'test_location.test_repo.["dynamic_in_multipartitions_success"]', 'key': dict({ 'path': list([ 'dynamic_in_multipartitions_success', @@ -190,7 +190,7 @@ }), }), dict({ - 'id': 'test.test_repo.["executable_asset"]', + 'id': 'test_location.test_repo.["executable_asset"]', 'key': dict({ 'path': list([ 'executable_asset', @@ -198,7 +198,7 @@ }), }), dict({ - 'id': 'test.test_repo.["fail_partition_materialization"]', + 'id': 'test_location.test_repo.["fail_partition_materialization"]', 'key': dict({ 'path': list([ 'fail_partition_materialization', @@ -206,7 +206,7 @@ }), }), dict({ - 'id': 'test.test_repo.["first_asset"]', + 'id': 'test_location.test_repo.["first_asset"]', 'key': dict({ 'path': list([ 'first_asset', @@ -214,7 +214,7 @@ }), }), dict({ - 'id': 'test.test_repo.["first_kinds_key"]', + 'id': 'test_location.test_repo.["first_kinds_key"]', 'key': dict({ 'path': list([ 'first_kinds_key', @@ -222,7 +222,7 @@ }), }), dict({ - 'id': 'test.test_repo.["foo"]', + 'id': 'test_location.test_repo.["foo"]', 'key': dict({ 'path': list([ 'foo', @@ -230,7 +230,7 @@ }), }), dict({ - 'id': 'test.test_repo.["foo_bar"]', + 'id': 'test_location.test_repo.["foo_bar"]', 'key': dict({ 'path': list([ 'foo_bar', @@ -238,7 +238,7 @@ }), }), dict({ - 'id': 'test.test_repo.["fourth_kinds_key"]', + 'id': 'test_location.test_repo.["fourth_kinds_key"]', 'key': dict({ 'path': list([ 'fourth_kinds_key', @@ -246,7 +246,7 @@ }), }), dict({ - 'id': 'test.test_repo.["fresh_diamond_bottom"]', + 'id': 'test_location.test_repo.["fresh_diamond_bottom"]', 'key': dict({ 'path': list([ 'fresh_diamond_bottom', @@ -254,7 +254,7 @@ }), }), dict({ - 'id': 'test.test_repo.["fresh_diamond_left"]', + 'id': 'test_location.test_repo.["fresh_diamond_left"]', 'key': dict({ 'path': list([ 'fresh_diamond_left', @@ -262,7 +262,7 @@ }), }), dict({ - 'id': 'test.test_repo.["fresh_diamond_right"]', + 'id': 'test_location.test_repo.["fresh_diamond_right"]', 'key': dict({ 'path': list([ 'fresh_diamond_right', @@ -270,7 +270,7 @@ }), }), dict({ - 'id': 'test.test_repo.["fresh_diamond_top"]', + 'id': 'test_location.test_repo.["fresh_diamond_top"]', 'key': dict({ 'path': list([ 'fresh_diamond_top', @@ -278,7 +278,7 @@ }), }), dict({ - 'id': 'test.test_repo.["grouped_asset_1"]', + 'id': 'test_location.test_repo.["grouped_asset_1"]', 'key': dict({ 'path': list([ 'grouped_asset_1', @@ -286,7 +286,7 @@ }), }), dict({ - 'id': 'test.test_repo.["grouped_asset_2"]', + 'id': 'test_location.test_repo.["grouped_asset_2"]', 'key': dict({ 'path': list([ 'grouped_asset_2', @@ -294,7 +294,7 @@ }), }), dict({ - 'id': 'test.test_repo.["grouped_asset_4"]', + 'id': 'test_location.test_repo.["grouped_asset_4"]', 'key': dict({ 'path': list([ 'grouped_asset_4', @@ -302,7 +302,7 @@ }), }), dict({ - 'id': 'test.test_repo.["hanging_asset"]', + 'id': 'test_location.test_repo.["hanging_asset"]', 'key': dict({ 'path': list([ 'hanging_asset', @@ -310,7 +310,7 @@ }), }), dict({ - 'id': 'test.test_repo.["hanging_graph"]', + 'id': 'test_location.test_repo.["hanging_graph"]', 'key': dict({ 'path': list([ 'hanging_graph', @@ -318,7 +318,7 @@ }), }), dict({ - 'id': 'test.test_repo.["hanging_partition_asset"]', + 'id': 'test_location.test_repo.["hanging_partition_asset"]', 'key': dict({ 'path': list([ 'hanging_partition_asset', @@ -326,7 +326,7 @@ }), }), dict({ - 'id': 'test.test_repo.["int_asset"]', + 'id': 'test_location.test_repo.["int_asset"]', 'key': dict({ 'path': list([ 'int_asset', @@ -334,7 +334,7 @@ }), }), dict({ - 'id': 'test.test_repo.["integers_asset"]', + 'id': 'test_location.test_repo.["integers_asset"]', 'key': dict({ 'path': list([ 'integers_asset', @@ -342,7 +342,7 @@ }), }), dict({ - 'id': 'test.test_repo.["middle_static_partitioned_asset_1"]', + 'id': 'test_location.test_repo.["middle_static_partitioned_asset_1"]', 'key': dict({ 'path': list([ 'middle_static_partitioned_asset_1', @@ -350,7 +350,7 @@ }), }), dict({ - 'id': 'test.test_repo.["middle_static_partitioned_asset_2"]', + 'id': 'test_location.test_repo.["middle_static_partitioned_asset_2"]', 'key': dict({ 'path': list([ 'middle_static_partitioned_asset_2', @@ -358,7 +358,7 @@ }), }), dict({ - 'id': 'test.test_repo.["multi_run_backfill_policy_asset"]', + 'id': 'test_location.test_repo.["multi_run_backfill_policy_asset"]', 'key': dict({ 'path': list([ 'multi_run_backfill_policy_asset', @@ -366,7 +366,7 @@ }), }), dict({ - 'id': 'test.test_repo.["multipartitions_1"]', + 'id': 'test_location.test_repo.["multipartitions_1"]', 'key': dict({ 'path': list([ 'multipartitions_1', @@ -374,7 +374,7 @@ }), }), dict({ - 'id': 'test.test_repo.["multipartitions_2"]', + 'id': 'test_location.test_repo.["multipartitions_2"]', 'key': dict({ 'path': list([ 'multipartitions_2', @@ -382,7 +382,7 @@ }), }), dict({ - 'id': 'test.test_repo.["multipartitions_fail"]', + 'id': 'test_location.test_repo.["multipartitions_fail"]', 'key': dict({ 'path': list([ 'multipartitions_fail', @@ -390,7 +390,7 @@ }), }), dict({ - 'id': 'test.test_repo.["never_runs_asset"]', + 'id': 'test_location.test_repo.["never_runs_asset"]', 'key': dict({ 'path': list([ 'never_runs_asset', @@ -398,7 +398,7 @@ }), }), dict({ - 'id': 'test.test_repo.["no_multipartitions_1"]', + 'id': 'test_location.test_repo.["no_multipartitions_1"]', 'key': dict({ 'path': list([ 'no_multipartitions_1', @@ -406,7 +406,7 @@ }), }), dict({ - 'id': 'test.test_repo.["not_included_asset"]', + 'id': 'test_location.test_repo.["not_included_asset"]', 'key': dict({ 'path': list([ 'not_included_asset', @@ -414,7 +414,7 @@ }), }), dict({ - 'id': 'test.test_repo.["one"]', + 'id': 'test_location.test_repo.["one"]', 'key': dict({ 'path': list([ 'one', @@ -422,7 +422,7 @@ }), }), dict({ - 'id': 'test.test_repo.["output_then_hang_asset"]', + 'id': 'test_location.test_repo.["output_then_hang_asset"]', 'key': dict({ 'path': list([ 'output_then_hang_asset', @@ -430,7 +430,7 @@ }), }), dict({ - 'id': 'test.test_repo.["second_kinds_key"]', + 'id': 'test_location.test_repo.["second_kinds_key"]', 'key': dict({ 'path': list([ 'second_kinds_key', @@ -438,7 +438,7 @@ }), }), dict({ - 'id': 'test.test_repo.["single_run_backfill_policy_asset"]', + 'id': 'test_location.test_repo.["single_run_backfill_policy_asset"]', 'key': dict({ 'path': list([ 'single_run_backfill_policy_asset', @@ -446,7 +446,7 @@ }), }), dict({ - 'id': 'test.test_repo.["str_asset"]', + 'id': 'test_location.test_repo.["str_asset"]', 'key': dict({ 'path': list([ 'str_asset', @@ -454,7 +454,7 @@ }), }), dict({ - 'id': 'test.test_repo.["third_kinds_key"]', + 'id': 'test_location.test_repo.["third_kinds_key"]', 'key': dict({ 'path': list([ 'third_kinds_key', @@ -462,7 +462,7 @@ }), }), dict({ - 'id': 'test.test_repo.["two"]', + 'id': 'test_location.test_repo.["two"]', 'key': dict({ 'path': list([ 'two', @@ -470,7 +470,7 @@ }), }), dict({ - 'id': 'test.test_repo.["typed_asset"]', + 'id': 'test_location.test_repo.["typed_asset"]', 'key': dict({ 'path': list([ 'typed_asset', @@ -478,7 +478,7 @@ }), }), dict({ - 'id': 'test.test_repo.["unconnected"]', + 'id': 'test_location.test_repo.["unconnected"]', 'key': dict({ 'path': list([ 'unconnected', @@ -486,7 +486,7 @@ }), }), dict({ - 'id': 'test.test_repo.["unexecutable_asset"]', + 'id': 'test_location.test_repo.["unexecutable_asset"]', 'key': dict({ 'path': list([ 'unexecutable_asset', @@ -494,7 +494,7 @@ }), }), dict({ - 'id': 'test.test_repo.["ungrouped_asset_3"]', + 'id': 'test_location.test_repo.["ungrouped_asset_3"]', 'key': dict({ 'path': list([ 'ungrouped_asset_3', @@ -502,7 +502,7 @@ }), }), dict({ - 'id': 'test.test_repo.["ungrouped_asset_5"]', + 'id': 'test_location.test_repo.["ungrouped_asset_5"]', 'key': dict({ 'path': list([ 'ungrouped_asset_5', @@ -510,7 +510,7 @@ }), }), dict({ - 'id': 'test.test_repo.["unpartitioned_upstream_of_partitioned"]', + 'id': 'test_location.test_repo.["unpartitioned_upstream_of_partitioned"]', 'key': dict({ 'path': list([ 'unpartitioned_upstream_of_partitioned', @@ -518,7 +518,7 @@ }), }), dict({ - 'id': 'test.test_repo.["untyped_asset"]', + 'id': 'test_location.test_repo.["untyped_asset"]', 'key': dict({ 'path': list([ 'untyped_asset', @@ -526,7 +526,7 @@ }), }), dict({ - 'id': 'test.test_repo.["upstream_daily_partitioned_asset"]', + 'id': 'test_location.test_repo.["upstream_daily_partitioned_asset"]', 'key': dict({ 'path': list([ 'upstream_daily_partitioned_asset', @@ -534,7 +534,7 @@ }), }), dict({ - 'id': 'test.test_repo.["upstream_dynamic_partitioned_asset"]', + 'id': 'test_location.test_repo.["upstream_dynamic_partitioned_asset"]', 'key': dict({ 'path': list([ 'upstream_dynamic_partitioned_asset', @@ -542,7 +542,7 @@ }), }), dict({ - 'id': 'test.test_repo.["upstream_static_partitioned_asset"]', + 'id': 'test_location.test_repo.["upstream_static_partitioned_asset"]', 'key': dict({ 'path': list([ 'upstream_static_partitioned_asset', @@ -550,7 +550,7 @@ }), }), dict({ - 'id': 'test.test_repo.["upstream_time_partitioned_asset"]', + 'id': 'test_location.test_repo.["upstream_time_partitioned_asset"]', 'key': dict({ 'path': list([ 'upstream_time_partitioned_asset', @@ -558,7 +558,7 @@ }), }), dict({ - 'id': 'test.test_repo.["yield_partition_materialization"]', + 'id': 'test_location.test_repo.["yield_partition_materialization"]', 'key': dict({ 'path': list([ 'yield_partition_materialization', @@ -597,137 +597,137 @@ dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["asset_1"]', + 'id': 'test_location.test_repo.["asset_1"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["asset_2"]', + 'id': 'test_location.test_repo.["asset_2"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["asset_3"]', + 'id': 'test_location.test_repo.["asset_3"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["asset_one"]', + 'id': 'test_location.test_repo.["asset_one"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["asset_two"]', + 'id': 'test_location.test_repo.["asset_two"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["asset_with_automation_condition"]', + 'id': 'test_location.test_repo.["asset_with_automation_condition"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["asset_with_custom_automation_condition"]', + 'id': 'test_location.test_repo.["asset_with_custom_automation_condition"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["asset_yields_observation"]', + 'id': 'test_location.test_repo.["asset_yields_observation"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["bar"]', + 'id': 'test_location.test_repo.["bar"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["baz"]', + 'id': 'test_location.test_repo.["baz"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["check_in_op_asset"]', + 'id': 'test_location.test_repo.["check_in_op_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["diamond_source"]', + 'id': 'test_location.test_repo.["diamond_source"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["downstream_asset"]', + 'id': 'test_location.test_repo.["downstream_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["downstream_dynamic_partitioned_asset"]', + 'id': 'test_location.test_repo.["downstream_dynamic_partitioned_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["downstream_static_partitioned_asset"]', + 'id': 'test_location.test_repo.["downstream_static_partitioned_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["downstream_time_partitioned_asset"]', + 'id': 'test_location.test_repo.["downstream_time_partitioned_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["downstream_weekly_partitioned_asset"]', + 'id': 'test_location.test_repo.["downstream_weekly_partitioned_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["dummy_source_asset"]', + 'id': 'test_location.test_repo.["dummy_source_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["dynamic_in_multipartitions_fail"]', + 'id': 'test_location.test_repo.["dynamic_in_multipartitions_fail"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["dynamic_in_multipartitions_success"]', + 'id': 'test_location.test_repo.["dynamic_in_multipartitions_success"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["executable_asset"]', + 'id': 'test_location.test_repo.["executable_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["fail_partition_materialization"]', + 'id': 'test_location.test_repo.["fail_partition_materialization"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["first_asset"]', + 'id': 'test_location.test_repo.["first_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["first_kinds_key"]', + 'id': 'test_location.test_repo.["first_kinds_key"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["foo"]', + 'id': 'test_location.test_repo.["foo"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["foo_bar"]', + 'id': 'test_location.test_repo.["foo_bar"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["fourth_kinds_key"]', + 'id': 'test_location.test_repo.["fourth_kinds_key"]', }), dict({ 'freshnessInfo': dict({ @@ -738,202 +738,202 @@ 'cronSchedule': None, 'maximumLagMinutes': 30.0, }), - 'id': 'test.test_repo.["fresh_diamond_bottom"]', + 'id': 'test_location.test_repo.["fresh_diamond_bottom"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["fresh_diamond_left"]', + 'id': 'test_location.test_repo.["fresh_diamond_left"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["fresh_diamond_right"]', + 'id': 'test_location.test_repo.["fresh_diamond_right"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["fresh_diamond_top"]', + 'id': 'test_location.test_repo.["fresh_diamond_top"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["grouped_asset_1"]', + 'id': 'test_location.test_repo.["grouped_asset_1"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["grouped_asset_2"]', + 'id': 'test_location.test_repo.["grouped_asset_2"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["grouped_asset_4"]', + 'id': 'test_location.test_repo.["grouped_asset_4"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["hanging_asset"]', + 'id': 'test_location.test_repo.["hanging_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["hanging_graph"]', + 'id': 'test_location.test_repo.["hanging_graph"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["hanging_partition_asset"]', + 'id': 'test_location.test_repo.["hanging_partition_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["int_asset"]', + 'id': 'test_location.test_repo.["int_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["integers_asset"]', + 'id': 'test_location.test_repo.["integers_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["middle_static_partitioned_asset_1"]', + 'id': 'test_location.test_repo.["middle_static_partitioned_asset_1"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["middle_static_partitioned_asset_2"]', + 'id': 'test_location.test_repo.["middle_static_partitioned_asset_2"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["multi_run_backfill_policy_asset"]', + 'id': 'test_location.test_repo.["multi_run_backfill_policy_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["multipartitions_1"]', + 'id': 'test_location.test_repo.["multipartitions_1"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["multipartitions_2"]', + 'id': 'test_location.test_repo.["multipartitions_2"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["multipartitions_fail"]', + 'id': 'test_location.test_repo.["multipartitions_fail"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["never_runs_asset"]', + 'id': 'test_location.test_repo.["never_runs_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["no_multipartitions_1"]', + 'id': 'test_location.test_repo.["no_multipartitions_1"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["not_included_asset"]', + 'id': 'test_location.test_repo.["not_included_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["one"]', + 'id': 'test_location.test_repo.["one"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["output_then_hang_asset"]', + 'id': 'test_location.test_repo.["output_then_hang_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["second_kinds_key"]', + 'id': 'test_location.test_repo.["second_kinds_key"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["single_run_backfill_policy_asset"]', + 'id': 'test_location.test_repo.["single_run_backfill_policy_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["str_asset"]', + 'id': 'test_location.test_repo.["str_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["third_kinds_key"]', + 'id': 'test_location.test_repo.["third_kinds_key"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["two"]', + 'id': 'test_location.test_repo.["two"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["typed_asset"]', + 'id': 'test_location.test_repo.["typed_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["unconnected"]', + 'id': 'test_location.test_repo.["unconnected"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["unexecutable_asset"]', + 'id': 'test_location.test_repo.["unexecutable_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["ungrouped_asset_3"]', + 'id': 'test_location.test_repo.["ungrouped_asset_3"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["ungrouped_asset_5"]', + 'id': 'test_location.test_repo.["ungrouped_asset_5"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["unpartitioned_upstream_of_partitioned"]', + 'id': 'test_location.test_repo.["unpartitioned_upstream_of_partitioned"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["untyped_asset"]', + 'id': 'test_location.test_repo.["untyped_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["upstream_daily_partitioned_asset"]', + 'id': 'test_location.test_repo.["upstream_daily_partitioned_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["upstream_dynamic_partitioned_asset"]', + 'id': 'test_location.test_repo.["upstream_dynamic_partitioned_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["upstream_static_partitioned_asset"]', + 'id': 'test_location.test_repo.["upstream_static_partitioned_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["upstream_time_partitioned_asset"]', + 'id': 'test_location.test_repo.["upstream_time_partitioned_asset"]', }), dict({ 'freshnessInfo': None, 'freshnessPolicy': None, - 'id': 'test.test_repo.["yield_partition_materialization"]', + 'id': 'test_location.test_repo.["yield_partition_materialization"]', }), ]), }) diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/graphql_context_test_suite.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/graphql_context_test_suite.py index 5fc86d5f0822a..9f9df41a02b64 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/graphql_context_test_suite.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/graphql_context_test_suite.py @@ -270,7 +270,7 @@ def _sqlite_asset_instance(): class EnvironmentManagers: @staticmethod - def managed_grpc(target=None, location_name="test"): + def managed_grpc(target=None, location_name="test_location"): @contextmanager def _mgr_fn(instance, read_only): """Relies on webserver to load the code location in a subprocess and manage its lifecyle.""" @@ -302,7 +302,7 @@ def _mgr_fn(instance, read_only): return MarkedManager(_mgr_fn, [Marks.managed_grpc_env]) @staticmethod - def deployed_grpc(target=None, location_name="test"): + def deployed_grpc(target=None, location_name="test_location"): """Launches a code server in a "dagster api grpc" subprocess.""" @contextmanager @@ -332,7 +332,7 @@ def _mgr_fn(instance, read_only): return MarkedManager(_mgr_fn, [Marks.deployed_grpc_env]) @staticmethod - def code_server_cli_grpc(target=None, location_name="test"): + def code_server_cli_grpc(target=None, location_name="test_location"): """Launches a code server in a "dagster code-server start" subprocess (which will in turn open up a `dagster api grpc` subprocess that actually loads the code location). """ @@ -399,7 +399,7 @@ def _mgr_fn(instance, read_only): python_file=file_relative_path(__file__, "repo.py"), attribute="test_dict_repo", working_directory=None, - location_name="test", + location_name="test_location", ), version="", read_only=read_only, @@ -518,7 +518,9 @@ def sqlite_with_queued_run_coordinator_managed_grpc_env(): ) @staticmethod - def sqlite_with_default_run_launcher_managed_grpc_env(target=None, location_name="test"): + def sqlite_with_default_run_launcher_managed_grpc_env( + target=None, location_name="test_location" + ): return GraphQLContextVariant( InstanceManagers.sqlite_instance_with_default_run_launcher(), EnvironmentManagers.managed_grpc(target, location_name), @@ -535,7 +537,9 @@ def sqlite_read_only_with_default_run_launcher_managed_grpc_env(): ) @staticmethod - def sqlite_with_default_run_launcher_deployed_grpc_env(target=None, location_name="test"): + def sqlite_with_default_run_launcher_deployed_grpc_env( + target=None, location_name="test_location" + ): return GraphQLContextVariant( InstanceManagers.sqlite_instance_with_default_run_launcher(), EnvironmentManagers.deployed_grpc(target, location_name), @@ -543,7 +547,9 @@ def sqlite_with_default_run_launcher_deployed_grpc_env(target=None, location_nam ) @staticmethod - def sqlite_with_default_run_launcher_code_server_cli_env(target=None, location_name="test"): + def sqlite_with_default_run_launcher_code_server_cli_env( + target=None, location_name="test_location" + ): return GraphQLContextVariant( InstanceManagers.sqlite_instance_with_default_run_launcher(), EnvironmentManagers.code_server_cli_grpc(target, location_name), @@ -551,7 +557,9 @@ def sqlite_with_default_run_launcher_code_server_cli_env(target=None, location_n ) @staticmethod - def postgres_with_default_run_launcher_managed_grpc_env(target=None, location_name="test"): + def postgres_with_default_run_launcher_managed_grpc_env( + target=None, location_name="test_location" + ): return GraphQLContextVariant( InstanceManagers.postgres_instance_with_default_run_launcher(), EnvironmentManagers.managed_grpc(target, location_name), @@ -559,7 +567,9 @@ def postgres_with_default_run_launcher_managed_grpc_env(target=None, location_na ) @staticmethod - def postgres_with_default_run_launcher_deployed_grpc_env(target=None, location_name="test"): + def postgres_with_default_run_launcher_deployed_grpc_env( + target=None, location_name="test_location" + ): return GraphQLContextVariant( InstanceManagers.postgres_instance_with_default_run_launcher(), EnvironmentManagers.deployed_grpc(target, location_name), @@ -655,7 +665,7 @@ def all_variants(): ] @staticmethod - def all_executing_variants(target=None, location_name="test"): + def all_executing_variants(target=None, location_name="test_location"): return [ GraphQLContextVariant.sqlite_with_default_run_launcher_managed_grpc_env( target, location_name diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/multi_location.yaml b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/multi_location.yaml index c1561f56259ac..59f462386aa75 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/multi_location.yaml +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/multi_location.yaml @@ -6,4 +6,4 @@ load_from: - python_file: relative_path: repo.py attribute: test_repo - location_name: test + location_name: test_location diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_assets.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_assets.py index f6e18b05942c0..0901f0b9af9da 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_assets.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_assets.py @@ -38,6 +38,7 @@ execute_dagster_graphql, infer_job_selector, infer_repository_selector, + main_repo_location_name, ) from dagster_graphql_tests.graphql.graphql_context_test_suite import ( @@ -1241,7 +1242,7 @@ def test_asset_node_in_pipeline(self, graphql_context: WorkspaceRequestContext): assert len(result.data["assetNodes"]) == 1 asset_node = result.data["assetNodes"][0] - assert asset_node["id"] == 'test.test_repo.["asset_one"]' + assert asset_node["id"] == f'{main_repo_location_name()}.test_repo.["asset_one"]' assert asset_node["hasMaterializePermission"] assert asset_node["hasReportRunlessAssetEventPermission"] @@ -1256,7 +1257,7 @@ def test_asset_node_in_pipeline(self, graphql_context: WorkspaceRequestContext): assert len(result.data["assetNodes"]) == 2 asset_node = result.data["assetNodes"][0] - assert asset_node["id"] == 'test.test_repo.["asset_one"]' + assert asset_node["id"] == f'{main_repo_location_name()}.test_repo.["asset_one"]' def test_asset_node_is_executable(self, graphql_context: WorkspaceRequestContext): result = execute_dagster_graphql( @@ -2126,7 +2127,7 @@ def test_reexecute_subset(self, graphql_context: WorkspaceRequestContext): def test_named_groups(self, graphql_context: WorkspaceRequestContext): _create_run(graphql_context, "named_groups_job") selector = { - "repositoryLocationName": "test", + "repositoryLocationName": main_repo_location_name(), "repositoryName": "test_repo", } @@ -2640,7 +2641,7 @@ def test_auto_materialize_policy(self, graphql_context: WorkspaceRequestContext) fresh_diamond_bottom = [ a for a in result.data["assetNodes"] - if a["id"] == 'test.test_repo.["fresh_diamond_bottom"]' + if a["id"] == f'{main_repo_location_name()}.test_repo.["fresh_diamond_bottom"]' ] assert len(fresh_diamond_bottom) == 1 assert fresh_diamond_bottom[0]["autoMaterializePolicy"]["policyType"] == "LAZY" @@ -2654,7 +2655,8 @@ def test_automation_condition(self, graphql_context: WorkspaceRequestContext): automation_condition_asset = [ a for a in result.data["assetNodes"] - if a["id"] == 'test.test_repo.["asset_with_automation_condition"]' + if a["id"] + == f'{main_repo_location_name()}.test_repo.["asset_with_automation_condition"]' ] assert len(automation_condition_asset) == 1 condition = automation_condition_asset[0]["automationCondition"] @@ -2664,7 +2666,8 @@ def test_automation_condition(self, graphql_context: WorkspaceRequestContext): custom_automation_condition_asset = [ a for a in result.data["assetNodes"] - if a["id"] == 'test.test_repo.["asset_with_custom_automation_condition"]' + if a["id"] + == f'{main_repo_location_name()}.test_repo.["asset_with_custom_automation_condition"]' ] assert len(custom_automation_condition_asset) == 1 condition = custom_automation_condition_asset[0]["automationCondition"] @@ -3084,7 +3087,7 @@ def test_asset_unstarted_after_materialization(self, graphql_context: WorkspaceR ) # Create two enqueued runs - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") job = repository.get_full_job("hanging_job") diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graph.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graph.py index 904c4bd608328..f21deae63d660 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graph.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graph.py @@ -1,5 +1,9 @@ from dagster._core.workspace.context import WorkspaceRequestContext -from dagster_graphql.test.utils import execute_dagster_graphql, infer_repository_selector +from dagster_graphql.test.utils import ( + execute_dagster_graphql, + infer_repository_selector, + main_repo_location_name, +) from dagster_graphql_tests.graphql.graphql_context_test_suite import ( NonLaunchableGraphQLContextTestMatrix, @@ -74,12 +78,17 @@ def test_basic_jobs(self, graphql_context: WorkspaceRequestContext): repo_locations = { blob["name"]: blob for blob in result.data["workspaceOrError"]["locationEntries"] } - assert "test" in repo_locations - assert repo_locations["test"]["locationOrLoadError"]["__typename"] == "RepositoryLocation" + assert main_repo_location_name() in repo_locations + assert ( + repo_locations[main_repo_location_name()]["locationOrLoadError"]["__typename"] + == "RepositoryLocation" + ) jobs = { blob["name"]: blob - for blob in repo_locations["test"]["locationOrLoadError"]["repositories"][0]["jobs"] + for blob in repo_locations[main_repo_location_name()]["locationOrLoadError"][ + "repositories" + ][0]["jobs"] } assert "simple_job_a" in jobs diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_partition_backfill.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_partition_backfill.py index f645ec05d7c71..073462d08a153 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_partition_backfill.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_partition_backfill.py @@ -43,6 +43,7 @@ execute_dagster_graphql_and_finish_runs, infer_job_selector, infer_repository_selector, + main_repo_location_name, ) from dagster_graphql_tests.graphql.graphql_context_test_suite import ( @@ -324,7 +325,7 @@ def dummy_asset(): class TestPartitionBackillReadonlyFailure(ReadonlyGraphQLContextTestMatrix): def _create_backfill(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") backfill = PartitionBackfill( @@ -656,7 +657,7 @@ def test_cancel_asset_backfill(self, graphql_context): # Update asset backfill data to contain requested partition, but does not execute side effects, # since launching the run will cause test process will hang forever. - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph _execute_asset_backfill_iteration_no_side_effects(graphql_context, backfill_id, asset_graph) @@ -732,7 +733,7 @@ def test_cancel_then_retry_asset_backfill(self, graphql_context): # Update asset backfill data to contain requested partition, but does not execute side effects, # since launching the run will cause test process will hang forever. - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph _execute_asset_backfill_iteration_no_side_effects(graphql_context, backfill_id, asset_graph) @@ -1043,7 +1044,7 @@ def test_asset_backfill_partition_stats(self, graphql_context): assert result.data["launchPartitionBackfill"]["__typename"] == "LaunchBackfillSuccess" backfill_id = result.data["launchPartitionBackfill"]["backfillId"] - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph @@ -1086,7 +1087,7 @@ def test_asset_backfill_partition_stats(self, graphql_context): assert asset_partition_status_counts[0]["numPartitionsFailed"] == 2 def test_asset_backfill_status_with_upstream_failure(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph @@ -1557,7 +1558,7 @@ def test_launch_backfill_with_all_partitions_flag(self, graphql_context): assert len(result.data["partitionBackfillOrError"]["partitionNames"]) == 10 def test_reexecute_asset_backfill_from_failure(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph @@ -1654,7 +1655,7 @@ def test_reexecute_asset_backfill_from_failure(self, graphql_context): assert retried_backfill.tags.get(ROOT_BACKFILL_ID_TAG) == backfill_id def test_reexecute_successful_asset_backfill(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph @@ -1741,7 +1742,7 @@ def test_reexecute_successful_asset_backfill(self, graphql_context): assert retried_backfill.tags.get(ROOT_BACKFILL_ID_TAG) == backfill_id def test_reexecute_asset_backfill_still_in_progress(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph @@ -1865,7 +1866,7 @@ def test_reexecute_asset_backfill_still_in_progress(self, graphql_context): assert retried_backfill.tags.get(ROOT_BACKFILL_ID_TAG) == backfill_id def test_reexecute_asset_backfill_twice(self, graphql_context): - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") asset_graph = repository.asset_graph diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py index cd7928bd61058..801c23152d52a 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_reload_repository_location.py @@ -9,7 +9,7 @@ from dagster._core.types.loadable_target_origin import LoadableTargetOrigin from dagster._core.workspace.load import location_origins_from_yaml_paths from dagster._grpc.types import ListRepositoriesResponse -from dagster_graphql.test.utils import execute_dagster_graphql +from dagster_graphql.test.utils import execute_dagster_graphql, main_repo_location_name from dagster_graphql_tests.graphql.graphql_context_test_suite import ( GraphQLContextVariant, @@ -252,7 +252,9 @@ def test_reload_workspace(self, graphql_context): class TestReloadRepositoriesReadOnly(ReadonlyGraphQLContextTestMatrix): def test_reload_repository_permission_failure(self, graphql_context): result = execute_dagster_graphql( - graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, {"repositoryLocationName": "test"} + graphql_context, + RELOAD_REPOSITORY_LOCATION_QUERY, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -264,14 +266,16 @@ def test_reload_repository_permission_failure(self, graphql_context): class TestReloadRepositoriesOutOfProcess(OutOfProcessTestSuite): def test_out_of_process_reload_location(self, graphql_context): result = execute_dagster_graphql( - graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, {"repositoryLocationName": "test"} + graphql_context, + RELOAD_REPOSITORY_LOCATION_QUERY, + {"repositoryLocationName": main_repo_location_name()}, ) assert result assert result.data assert result.data["reloadRepositoryLocation"] assert result.data["reloadRepositoryLocation"]["__typename"] == "WorkspaceLocationEntry" - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() repositories = result.data["reloadRepositoryLocation"]["locationOrLoadError"][ "repositories" ] @@ -315,7 +319,7 @@ def new_repo(): result = execute_dagster_graphql( graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert cli_command_mock.call_count == 1 @@ -329,7 +333,9 @@ def new_repo(): def test_reload_failure(self, graphql_context): result = execute_dagster_graphql( - graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, {"repositoryLocationName": "test"} + graphql_context, + RELOAD_REPOSITORY_LOCATION_QUERY, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -339,7 +345,7 @@ def test_reload_failure(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "RepositoryLocation" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() repositories = result.data["reloadRepositoryLocation"]["locationOrLoadError"][ "repositories" ] @@ -361,7 +367,7 @@ def test_reload_failure(self, graphql_context): result = execute_dagster_graphql( graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -371,7 +377,7 @@ def test_reload_failure(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "PythonError" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() assert ( "Mocked repository load failure" in result.data["reloadRepositoryLocation"]["locationOrLoadError"]["message"] @@ -381,7 +387,7 @@ def test_reload_failure(self, graphql_context): result = execute_dagster_graphql( graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -391,7 +397,7 @@ def test_reload_failure(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "PythonError" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() assert ( "Mocked repository load failure" in result.data["reloadRepositoryLocation"]["locationOrLoadError"]["message"] @@ -401,7 +407,7 @@ def test_reload_failure(self, graphql_context): result = execute_dagster_graphql( graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -411,7 +417,7 @@ def test_reload_failure(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "RepositoryLocation" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() assert result.data["reloadRepositoryLocation"]["loadStatus"] == "LOADED" repositories = result.data["reloadRepositoryLocation"]["locationOrLoadError"][ "repositories" @@ -427,7 +433,9 @@ def test_reload_failure(self, graphql_context): class TestReloadRepositoriesManagedGrpc(ManagedTestSuite): def test_managed_grpc_reload_location(self, graphql_context): result = execute_dagster_graphql( - graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, {"repositoryLocationName": "test"} + graphql_context, + RELOAD_REPOSITORY_LOCATION_QUERY, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -437,7 +445,7 @@ def test_managed_grpc_reload_location(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "RepositoryLocation" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() assert result.data["reloadRepositoryLocation"]["loadStatus"] == "LOADED" repositories = result.data["reloadRepositoryLocation"]["locationOrLoadError"][ @@ -465,12 +473,12 @@ class TestReloadLocationCodeServerCliGrpc(CodeServerCliTestSuite): def test_code_server_cli_reload_location(self, graphql_context): # server_id before - old_server_id = graphql_context.get_code_location("test").server_id + old_server_id = graphql_context.get_code_location(main_repo_location_name()).server_id result = execute_dagster_graphql( graphql_context, RELOAD_REPOSITORY_LOCATION_QUERY, - {"repositoryLocationName": "test"}, + {"repositoryLocationName": main_repo_location_name()}, ) assert result @@ -480,12 +488,12 @@ def test_code_server_cli_reload_location(self, graphql_context): result.data["reloadRepositoryLocation"]["locationOrLoadError"]["__typename"] == "RepositoryLocation" ) - assert result.data["reloadRepositoryLocation"]["name"] == "test" + assert result.data["reloadRepositoryLocation"]["name"] == main_repo_location_name() assert result.data["reloadRepositoryLocation"]["loadStatus"] == "LOADED" new_location = ( graphql_context.process_context.get_workspace_snapshot() - .code_location_entries["test"] + .code_location_entries[main_repo_location_name()] .code_location ) diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_retry_execution.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_retry_execution.py index 0442242d02619..9d51a84c69147 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_retry_execution.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_retry_execution.py @@ -18,6 +18,7 @@ execute_dagster_graphql, execute_dagster_graphql_and_finish_runs, infer_job_selector, + main_repo_location_name, ) from dagster_graphql_tests.graphql.graphql_context_test_suite import ( @@ -69,7 +70,7 @@ class TestRetryExecutionReadonly(ReadonlyGraphQLContextTestMatrix): def test_retry_execution_permission_failure(self, graphql_context: WorkspaceRequestContext): selector = infer_job_selector(graphql_context, "eventually_successful") - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") remote_job_origin = repository.get_full_job("eventually_successful").get_remote_origin() diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_runs_feed.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_runs_feed.py index 2455e716759f6..b6bc8d9ff5003 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_runs_feed.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_runs_feed.py @@ -12,7 +12,7 @@ from dagster._core.utils import make_new_backfill_id from dagster._time import get_current_timestamp from dagster_graphql.implementation.fetch_runs import RunsFeedCursor -from dagster_graphql.test.utils import execute_dagster_graphql +from dagster_graphql.test.utils import execute_dagster_graphql, main_repo_location_name from dagster_graphql_tests.graphql.graphql_context_test_suite import ( ExecutingGraphQLContextTestMatrix, @@ -951,7 +951,7 @@ def test_get_runs_feed_filter_create_time(self, graphql_context): def test_get_runs_feed_filter_job_name(self, graphql_context): if not self.supports_filtering(): return pytest.skip("storage does not support filtering backfills by job_name") - code_location = graphql_context.get_code_location("test") + code_location = graphql_context.get_code_location(main_repo_location_name()) repository = code_location.get_repository("test_repo") partition_set_origin = RemotePartitionSetOrigin( diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_workspace.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_workspace.py index 69b78b26918e7..6fb588b26e34f 100644 --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_workspace.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_workspace.py @@ -11,7 +11,7 @@ from dagster._core.types.loadable_target_origin import LoadableTargetOrigin from dagster._core.workspace.load import location_origins_from_yaml_paths from dagster.version import __version__ as dagster_version -from dagster_graphql.test.utils import execute_dagster_graphql +from dagster_graphql.test.utils import execute_dagster_graphql, main_repo_location_name from dagster_graphql.version import __version__ as dagster_graphql_version from dagster_graphql_tests.graphql.graphql_context_test_suite import ( @@ -329,7 +329,9 @@ def test_load_workspace_masked(self, graphql_context, enable_masking_user_code_e ) def test_workspace_entry_by_name(self, graphql_context) -> None: - result = execute_dagster_graphql(graphql_context, LOCATION_ENTRY_QUERY, {"name": "test"}) + result = execute_dagster_graphql( + graphql_context, LOCATION_ENTRY_QUERY, {"name": main_repo_location_name()} + ) assert result assert result.data["workspaceLocationEntryOrError"] assert ( @@ -352,7 +354,7 @@ def test_workspace_entry_by_name(self, graphql_context) -> None: mock_fetch.side_effect = Exception("boom") result = execute_dagster_graphql( - graphql_context, LOCATION_ENTRY_QUERY, {"name": "test"} + graphql_context, LOCATION_ENTRY_QUERY, {"name": main_repo_location_name()} ) assert result assert result.data["workspaceLocationEntryOrError"]