airflow.providers.apache.polaris.operators.namespace

Operators that create, update and drop namespaces in a Polaris catalog.

Classes

PolarisCreateNamespaceOperator

Create a namespace in a Polaris catalog.

PolarisUpdateNamespacePropertiesOperator

Set and/or remove properties of a namespace. Re-running it is safe.

PolarisDropNamespaceOperator

Drop an empty namespace. Polaris refuses to drop one that still has contents.

Module Contents

class airflow.providers.apache.polaris.operators.namespace.PolarisCreateNamespaceOperator(*, namespace, properties=None, catalog=None, if_exists='skip', **kwargs)[source]

Bases: airflow.providers.apache.polaris.operators.base.PolarisCatalogBaseOperator

Create a namespace in a Polaris catalog.

See also

For more information, take a look at the guide: PolarisCreateNamespaceOperator

Parameters:
  • namespace (str | list[str]) – Namespace to create, as "a.b" or ["a", "b"]; its parent must exist.

  • properties (dict[str, str] | None) – Optional namespace properties, for example {"owner": "data-eng"}; values are strings.

  • catalog (str | None) – Catalog; defaults to the connection’s default_catalog.

  • if_exists (airflow.providers.apache.polaris.hooks.polaris.IfExists) – "skip" (default) succeeds and returns the existing namespace unchanged; "fail" raises.

  • polaris_conn_id – Polaris connection id.

Returns:

{"namespace": [...], "properties": {...}}. Polaris adds a location property.

template_fields: collections.abc.Sequence[str] = ('polaris_conn_id', 'namespace', 'properties', 'catalog')[source]
template_fields_renderers[source]
namespace[source]
properties = None[source]
catalog = None[source]
if_exists = 'skip'[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.apache.polaris.operators.namespace.PolarisUpdateNamespacePropertiesOperator(*, namespace, updates=None, removals=None, catalog=None, **kwargs)[source]

Bases: airflow.providers.apache.polaris.operators.base.PolarisCatalogBaseOperator

Set and/or remove properties of a namespace. Re-running it is safe.

See also

For more information, take a look at the guide: PolarisUpdateNamespacePropertiesOperator

Parameters:
  • namespace (str | list[str]) – Namespace, as "a.b" or ["a", "b"].

  • updates (dict[str, str] | None) – Properties to set; values are strings.

  • removals (list[str] | None) – Property keys to remove; keys that do not exist are reported as missing. A key cannot be both updated and removed.

  • catalog (str | None) – Catalog; defaults to the connection’s default_catalog.

  • polaris_conn_id – Polaris connection id.

Returns:

{"updated": [...], "removed": [...], "missing": [...]}: property keys.

template_fields: collections.abc.Sequence[str] = ('polaris_conn_id', 'namespace', 'updates', 'removals', 'catalog')[source]
template_fields_renderers[source]
namespace[source]
updates = None[source]
removals = None[source]
catalog = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.apache.polaris.operators.namespace.PolarisDropNamespaceOperator(*, namespace, catalog=None, if_missing='skip', **kwargs)[source]

Bases: airflow.providers.apache.polaris.operators.base.PolarisCatalogBaseOperator

Drop an empty namespace. Polaris refuses to drop one that still has contents.

See also

For more information, take a look at the guide: PolarisDropNamespaceOperator

Parameters:
Returns:

True if the namespace was dropped, False if it did not exist.

template_fields: collections.abc.Sequence[str] = ('polaris_conn_id', 'namespace', 'catalog')[source]
namespace[source]
catalog = None[source]
if_missing = 'skip'[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?