ds_resource_plugin_py_lib.common.resource.linked_service.base

File: base.py Region: ds_resource_plugin_py_lib/common/resource/linked_service

Description

Base models for linked services.

Attributes

LinkedServiceSettingsType

Classes

LinkedServiceInfo

NamedTuple that represents the linked service information.

LinkedServiceSettings

The object containing the settings of the linked service.

LinkedService

The object containing the connection information to connect with related data store.

Module Contents

class ds_resource_plugin_py_lib.common.resource.linked_service.base.LinkedServiceInfo[source]

Bases: NamedTuple

NamedTuple that represents the linked service information.

type: str
name: str
class_name: str
version: str
description: str | None = None
__str__() str[source]

Return a string representation of the linked service info.

Returns:

A string representation of the linked service info.

property key: tuple[str, str]

Return the composite key (type, version) for dictionary lookups.

Returns:

A tuple containing the type and version.

class ds_resource_plugin_py_lib.common.resource.linked_service.base.LinkedServiceSettings[source]

Bases: ds_common_serde_py_lib.Serializable

The object containing the settings of the linked service.

ds_resource_plugin_py_lib.common.resource.linked_service.base.LinkedServiceSettingsType
class ds_resource_plugin_py_lib.common.resource.linked_service.base.LinkedService[source]

Bases: abc.ABC, ds_common_serde_py_lib.Serializable, Generic[LinkedServiceSettingsType]

The object containing the connection information to connect with related data store.

You probably want to use the subclasses and not this class directly. Known subclasses are: - SftpLinkedService - S3LinkedService - GraphQlLinkedService

All required parameters must be populated in the constructor in order to send to ds-workflow-service.

id: uuid.UUID
name: str
description: str | None = None
version: str
settings: LinkedServiceSettingsType
__enter__() Self[source]

Context manager enter.

Returns:

The linked service.

__exit__(exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: types.TracebackType | None) None[source]

Context manager exit.

Parameters:
  • exc_type – The type of the exception.

  • exc_value – The value of the exception.

  • traceback – The traceback of the exception.

property type: enum.StrEnum
Abstractmethod:

Get the type of the linked service.

Returns:

The type of the linked service.

property connection: Any
Abstractmethod:

Return the backend client or connection object. Must raise ConnectionError if connect() has not been called.

Returns:

The backend client, session, or connection object.

Raises:

ConnectionError – If the connection has not been established.

See also

Full contract: docs/LINKED_SERVICE_CONTRACT.mdconnection

abstractmethod connect() None[source]

Establish a connection to the backend data store. The result is stored internally and accessible via the connection property.

Raises:

See also

Full contract: docs/LINKED_SERVICE_CONTRACT.mdconnect()

abstractmethod test_connection() tuple[bool, str][source]

Verify that the connection to the backend is healthy. Does not raise on connection failure – returns (False, "reason") instead.

Returns:

(True, ""). On failure: (False, "error description").

Return type:

A tuple (success, message). On success

Raises:

NotSupportedError – If the provider does not support test_connection.

See also

Full contract: docs/LINKED_SERVICE_CONTRACT.mdtest_connection()

abstractmethod close() None[source]

Release connections, sessions, or handles. Must not raise if already closed. Idempotent.

See also

Full contract: docs/LINKED_SERVICE_CONTRACT.mdclose()