airflow.providers.apache.polaris.exceptions

Exceptions raised by the Apache Polaris provider.

Attributes

ALREADY_EXISTS_TYPE

STALE_VERSION_TYPES

PERMANENT_CONFLICT_TYPES

Exceptions

PolarisError

Base class for errors raised by the Apache Polaris provider.

PolarisConnectionError

A polaris connection is misconfigured; detected locally before any network call.

PolarisInvalidArgumentError

An argument is invalid, e.g. a malformed namespace or policy content that is not JSON.

PolarisRequestError

A request to Polaris did not complete (connection refused, timeout, broken connection).

PolarisAuthenticationError

Getting a token failed, or Polaris rejected the token, the realm or the principal's roles.

PolarisApiError

A Polaris API call failed for a reason other than authentication.

PolarisForbiddenError

HTTP 403: authenticated, but the principal's active roles lack a required privilege.

PolarisNotFoundError

HTTP 404: the catalog, principal, role, namespace, table or policy does not exist.

PolarisConflictError

HTTP 409: the request conflicts with the entity's current state.

Functions

is_retryable_status(status)

Whether a request that failed with this HTTP status may succeed when simply sent again.

Module Contents

airflow.providers.apache.polaris.exceptions.is_retryable_status(status)[source]

Whether a request that failed with this HTTP status may succeed when simply sent again.

Server errors (5xx, except 501 Not Implemented), timeouts (408), rate limiting (429) and conflicts (409, e.g. a concurrent update) are retryable. Other client errors (bad request, unauthenticated, forbidden, not found) are not: the request or the access has to change first.

airflow.providers.apache.polaris.exceptions.ALREADY_EXISTS_TYPE = 'AlreadyExistsException'[source]
airflow.providers.apache.polaris.exceptions.STALE_VERSION_TYPES[source]
airflow.providers.apache.polaris.exceptions.PERMANENT_CONFLICT_TYPES[source]
exception airflow.providers.apache.polaris.exceptions.PolarisError[source]

Bases: Exception

Base class for errors raised by the Apache Polaris provider.

Not an AirflowException subclass, matching recent providers: callers catch provider errors through this base, and the exceptions carry no Airflow task-state semantics.

retryable tells whether retrying the same call could succeed. Operators fail their task without retries when it is false; code calling the hooks directly can check it the same way.

retryable: bool = True[source]
exception airflow.providers.apache.polaris.exceptions.PolarisConnectionError[source]

Bases: PolarisError

A polaris connection is misconfigured; detected locally before any network call.

retryable = False[source]
exception airflow.providers.apache.polaris.exceptions.PolarisInvalidArgumentError[source]

Bases: PolarisError, ValueError

An argument is invalid, e.g. a malformed namespace or policy content that is not JSON.

retryable = False[source]
exception airflow.providers.apache.polaris.exceptions.PolarisRequestError[source]

Bases: PolarisError

A request to Polaris did not complete (connection refused, timeout, broken connection).

exception airflow.providers.apache.polaris.exceptions.PolarisAuthenticationError(message, *, retryable=False)[source]

Bases: PolarisError

Getting a token failed, or Polaris rejected the token, the realm or the principal’s roles.

Parameters:
  • message (str) – What failed and what to check.

  • retryable (bool) – True when the failure may be transient (the token endpoint was unreachable or returned a server error); false when credentials, scope or realm were rejected.

retryable = False[source]
exception airflow.providers.apache.polaris.exceptions.PolarisApiError(status, message, error_type=None)[source]

Bases: PolarisError

A Polaris API call failed for a reason other than authentication.

Parameters:
  • status (int) – HTTP status code returned by Polaris.

  • message (str) – Error message, from Polaris’s error response when it sent one.

  • error_type (str | None) – Polaris error type (for example AlreadyExistsException), if any.

status[source]
message[source]
error_type = None[source]
retryable[source]
exception airflow.providers.apache.polaris.exceptions.PolarisForbiddenError(status, message, error_type=None)[source]

Bases: PolarisApiError

HTTP 403: authenticated, but the principal’s active roles lack a required privilege.

exception airflow.providers.apache.polaris.exceptions.PolarisNotFoundError(status, message, error_type=None)[source]

Bases: PolarisApiError

HTTP 404: the catalog, principal, role, namespace, table or policy does not exist.

exception airflow.providers.apache.polaris.exceptions.PolarisConflictError(status, message, error_type=None)[source]

Bases: PolarisApiError

HTTP 409: the request conflicts with the entity’s current state.

The entity may already exist (already_exists), the update may be based on a version that is no longer current (stale_version), or the state may forbid it, for example a namespace that is not empty. Only stale versions and other concurrent changes are retryable (see PERMANENT_CONFLICT_TYPES).

property already_exists: bool[source]

Whether a create found the entity already in place.

property stale_version: bool[source]

Whether an update was based on a version that is no longer current.

Was this entry helpful?