def get_external_partition_names(self, repository_handle, partition_set_name): check.inst_param(repository_handle, 'repository_handle', RepositoryHandle) check.str_param(partition_set_name, 'partition_set_name') args = PartitionNamesArgs( repository_origin=repository_handle.get_origin(), partition_set_name=partition_set_name ) return get_partition_names(args)
def sync_get_external_partition_names_grpc(api_client, repository_handle, partition_set_name): check.inst_param(api_client, 'api_client', DagsterGrpcClient) check.inst_param(repository_handle, 'repository_handle', RepositoryHandle) check.str_param(partition_set_name, 'partition_set_name') repository_origin = repository_handle.get_origin() return check.inst( api_client.external_partition_names( partition_names_args=PartitionNamesArgs( repository_origin=repository_origin, partition_set_name=partition_set_name, ), ), (ExternalPartitionNamesData, ExternalPartitionExecutionErrorData), )
def sync_get_external_partition_names(repository_handle, partition_set_name): check.inst_param(repository_handle, "repository_handle", RepositoryHandle) check.str_param(partition_set_name, "partition_set_name") repository_origin = repository_handle.get_origin() return check.inst( execute_unary_api_cli_command( repository_origin.executable_path, "partition_names", PartitionNamesArgs(repository_origin=repository_origin, partition_set_name=partition_set_name), ), (ExternalPartitionNamesData, ExternalPartitionExecutionErrorData), )
def sync_get_external_partition_names_grpc(api_client, repository_handle, partition_set_name): from dagster.grpc.client import DagsterGrpcClient check.inst_param(api_client, "api_client", DagsterGrpcClient) check.inst_param(repository_handle, "repository_handle", RepositoryHandle) check.str_param(partition_set_name, "partition_set_name") repository_origin = repository_handle.get_external_origin() return check.inst( api_client.external_partition_names( partition_names_args=PartitionNamesArgs( repository_origin=repository_origin, partition_set_name=partition_set_name, ), ), (ExternalPartitionNamesData, ExternalPartitionExecutionErrorData), )
def sync_get_external_partition_names_grpc(repository_handle, partition_set_name): check.inst_param(repository_handle, 'repository_handle', RepositoryHandle) check.str_param(partition_set_name, 'partition_set_name') repository_origin = repository_handle.get_origin() with ephemeral_grpc_api_client( python_executable_path=repository_origin.executable_path ) as api_client: return check.inst( api_client.external_partition_names( partition_names_args=PartitionNamesArgs( repository_origin=repository_origin, partition_set_name=partition_set_name, ), ), (ExternalPartitionNamesData, ExternalPartitionExecutionErrorData), )
def sync_get_external_partition_names_grpc(api_client, repository_handle, partition_set_name): from dagster.grpc.client import DagsterGrpcClient check.inst_param(api_client, "api_client", DagsterGrpcClient) check.inst_param(repository_handle, "repository_handle", RepositoryHandle) check.str_param(partition_set_name, "partition_set_name") repository_origin = repository_handle.get_external_origin() result = check.inst( api_client.external_partition_names( partition_names_args=PartitionNamesArgs( repository_origin=repository_origin, partition_set_name=partition_set_name, ), ), (ExternalPartitionNamesData, ExternalPartitionExecutionErrorData), ) if isinstance(result, ExternalPartitionExecutionErrorData): raise DagsterUserCodeProcessError.from_error_info(result.error) return result