Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster/dagster/core/host_representation/external.py
from collections import OrderedDict | from collections import OrderedDict | ||||
from dagster import check | from dagster import check | ||||
from dagster.core.snap import ExecutionPlanSnapshot | from dagster.core.snap import ExecutionPlanSnapshot | ||||
from dagster.core.utils import toposort | from dagster.core.utils import toposort | ||||
from .external_data import ( | from .external_data import ( | ||||
ExternalExecutableData, | ExternalJobData, | ||||
ExternalPartitionSetData, | ExternalPartitionSetData, | ||||
ExternalPipelineData, | ExternalPipelineData, | ||||
ExternalRepositoryData, | ExternalRepositoryData, | ||||
ExternalScheduleData, | ExternalScheduleData, | ||||
) | ) | ||||
from .handle import PartitionSetHandle, PipelineHandle, RepositoryHandle, ScheduleHandle | from .handle import PartitionSetHandle, PipelineHandle, RepositoryHandle, ScheduleHandle | ||||
from .pipeline_index import PipelineIndex | from .pipeline_index import PipelineIndex | ||||
from .represented import RepresentedPipeline | from .represented import RepresentedPipeline | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | def get_full_external_pipeline(self, pipeline_name): | ||||
self.external_repository_data.get_external_pipeline_data(pipeline_name), | self.external_repository_data.get_external_pipeline_data(pipeline_name), | ||||
repository_handle=self.handle, | repository_handle=self.handle, | ||||
pipeline_index=self.get_pipeline_index(pipeline_name), | pipeline_index=self.get_pipeline_index(pipeline_name), | ||||
) | ) | ||||
def get_all_external_pipelines(self): | def get_all_external_pipelines(self): | ||||
return [self.get_full_external_pipeline(pn) for pn in self._pipeline_index_map] | return [self.get_full_external_pipeline(pn) for pn in self._pipeline_index_map] | ||||
def get_external_executables(self): | def get_external_jobs(self): | ||||
return [ | return [ | ||||
ExternalExecutable(external_executable_data, self._handle) | ExternalJob(external_job_data, self._handle) | ||||
for external_executable_data in self.external_repository_data.external_executable_datas | for external_job_data in self.external_repository_data.external_job_datas | ||||
] | ] | ||||
@property | @property | ||||
def handle(self): | def handle(self): | ||||
return self._handle | return self._handle | ||||
def get_origin(self): | def get_origin(self): | ||||
return self._handle.get_origin() | return self._handle.get_origin() | ||||
▲ Show 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | class ExternalPartitionSet: | ||||
def mode(self): | def mode(self): | ||||
return self._external_partition_set_data.mode | return self._external_partition_set_data.mode | ||||
@property | @property | ||||
def pipeline_name(self): | def pipeline_name(self): | ||||
return self._external_partition_set_data.pipeline_name | return self._external_partition_set_data.pipeline_name | ||||
class ExternalExecutable: | class ExternalJob: | ||||
def __init__(self, external_executable_data, handle): | def __init__(self, external_job_data, handle): | ||||
self._external_executable_data = check.inst_param( | self._external_job_data = check.inst_param( | ||||
external_executable_data, "external_executable_data", ExternalExecutableData, | external_job_data, "external_job_data", ExternalJobData, | ||||
) | ) | ||||
self._handle = check.inst_param(handle, "handle", RepositoryHandle) | self._handle = check.inst_param(handle, "handle", RepositoryHandle) | ||||
@property | @property | ||||
def name(self): | def name(self): | ||||
return self._external_executable_data.name | return self._external_job_data.name | ||||
@property | @property | ||||
def pipeline_name(self): | def pipeline_name(self): | ||||
return self._external_executable_data.pipeline_name | return self._external_job_data.pipeline_name | ||||
@property | @property | ||||
def solid_selection(self): | def solid_selection(self): | ||||
return self._external_executable_data.solid_selection | return self._external_job_data.solid_selection | ||||
@property | @property | ||||
def mode(self): | def mode(self): | ||||
return self._external_executable_data.mode | return self._external_job_data.mode |