Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster/dagster/cli/workspace/load.py
import os | import os | ||||
import sys | import sys | ||||
import warnings | import warnings | ||||
import six | import six | ||||
from dagster import check | from dagster import check | ||||
from dagster.core.code_pointer import CodePointer, rebase_file | from dagster.core.code_pointer import rebase_file | ||||
from dagster.core.definitions.reconstructable import ReconstructableRepository | |||||
from dagster.core.host_representation import ( | from dagster.core.host_representation import ( | ||||
GrpcServerRepositoryLocationOrigin, | GrpcServerRepositoryLocationOrigin, | ||||
InProcessRepositoryLocationOrigin, | InProcessRepositoryLocationOrigin, | ||||
ManagedGrpcPythonEnvRepositoryLocationOrigin, | ManagedGrpcPythonEnvRepositoryLocationOrigin, | ||||
PythonEnvRepositoryLocationOrigin, | PythonEnvRepositoryLocationOrigin, | ||||
UserProcessApi, | UserProcessApi, | ||||
) | ) | ||||
from dagster.core.types.loadable_target_origin import LoadableTargetOrigin | from dagster.core.types.loadable_target_origin import LoadableTargetOrigin | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | def _repo_location_origins_from_config(workspace_config, yaml_path, python_user_process_api): | ||||
if "repository" in workspace_config: | if "repository" in workspace_config: | ||||
warnings.warn( | warnings.warn( | ||||
# link to docs once they exist | # link to docs once they exist | ||||
"You are using the legacy repository yaml format. Please update your file " | "You are using the legacy repository yaml format. Please update your file " | ||||
"to abide by the new workspace file format." | "to abide by the new workspace file format." | ||||
) | ) | ||||
origin = InProcessRepositoryLocationOrigin( | origin = InProcessRepositoryLocationOrigin( | ||||
CodePointer.from_legacy_repository_yaml(yaml_path) | ReconstructableRepository.from_legacy_repository_yaml(yaml_path) | ||||
) | ) | ||||
return {origin.location_name: origin} | return {origin.location_name: origin} | ||||
location_origins = {} | location_origins = {} | ||||
for location_config in workspace_config["load_from"]: | for location_config in workspace_config["load_from"]: | ||||
origin = _location_origin_from_location_config( | origin = _location_origin_from_location_config( | ||||
location_config, yaml_path, python_user_process_api | location_config, yaml_path, python_user_process_api | ||||
▲ Show 20 Lines • Show All 280 Lines • Show Last 20 Lines |