airbyte.exceptions

All exceptions used in the PyAirbyte.

This design is modeled after structlog's exceptions, in that we bias towards auto-generated property prints rather than sentence-like string concatenation.

E.g. Instead of this:

Subprocess failed with exit code '1'

We do this:

Subprocess failed. (exit_code=1)

The benefit of this approach is that we can easily support structured logging, and we can easily add new properties to exceptions without having to update all the places where they are raised. We can also support any arbitrary number of properties in exceptions, without spending time on building sentence-like string constructions with optional inputs.

In addition, the following principles are applied for exception class design:

  • All exceptions inherit from a common base class.
  • All exceptions have a message attribute.
  • The first line of the docstring is used as the default message.
  • The default message can be overridden by explicitly setting the message attribute.
  • Exceptions may optionally have a guidance attribute.
  • Exceptions may optionally have a help_url attribute.
  • Rendering is automatically handled by the base class.
  • Any helpful context not defined by the exception class can be passed in the context dict arg.
  • Within reason, avoid sending PII to the exception constructor.
  • Exceptions are dataclasses, so they can be instantiated with keyword arguments.
  • Use the 'from' syntax to chain exceptions when it is helpful to do so. E.g. raise AirbyteConnectorNotFoundError(...) from FileNotFoundError(connector_path)
  • Any exception that adds a new property should also be decorated as @dataclass.
  1# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
  2
  3"""All exceptions used in the PyAirbyte.
  4
  5This design is modeled after structlog's exceptions, in that we bias towards auto-generated
  6property prints rather than sentence-like string concatenation.
  7
  8E.g. Instead of this:
  9
 10> `Subprocess failed with exit code '1'`
 11
 12We do this:
 13
 14> `Subprocess failed. (exit_code=1)`
 15
 16The benefit of this approach is that we can easily support structured logging, and we can
 17easily add new properties to exceptions without having to update all the places where they
 18are raised. We can also support any arbitrary number of properties in exceptions, without spending
 19time on building sentence-like string constructions with optional inputs.
 20
 21
 22In addition, the following principles are applied for exception class design:
 23
 24- All exceptions inherit from a common base class.
 25- All exceptions have a message attribute.
 26- The first line of the docstring is used as the default message.
 27- The default message can be overridden by explicitly setting the message attribute.
 28- Exceptions may optionally have a guidance attribute.
 29- Exceptions may optionally have a help_url attribute.
 30- Rendering is automatically handled by the base class.
 31- Any helpful context not defined by the exception class can be passed in the `context` dict arg.
 32- Within reason, avoid sending PII to the exception constructor.
 33- Exceptions are dataclasses, so they can be instantiated with keyword arguments.
 34- Use the 'from' syntax to chain exceptions when it is helpful to do so.
 35  E.g. `raise AirbyteConnectorNotFoundError(...) from FileNotFoundError(connector_path)`
 36- Any exception that adds a new property should also be decorated as `@dataclass`.
 37"""
 38from __future__ import annotations
 39
 40from dataclasses import dataclass
 41from textwrap import indent
 42from typing import TYPE_CHECKING, Any
 43
 44
 45if TYPE_CHECKING:
 46    from airbyte._util.api_duck_types import AirbyteApiResponseDuckType
 47    from airbyte.cloud.workspaces import CloudWorkspace
 48
 49
 50NEW_ISSUE_URL = "https://github.com/airbytehq/airbyte/issues/new/choose"
 51DOCS_URL = "https://docs.airbyte.io/"
 52
 53
 54# Base error class
 55
 56
 57@dataclass
 58class PyAirbyteError(Exception):
 59    """Base class for exceptions in Airbyte."""
 60
 61    guidance: str | None = None
 62    help_url: str | None = None
 63    log_text: str | list[str] | None = None
 64    context: dict[str, Any] | None = None
 65    message: str | None = None
 66
 67    def get_message(self) -> str:
 68        """Return the best description for the exception.
 69
 70        We resolve the following in order:
 71        1. The message sent to the exception constructor (if provided).
 72        2. The first line of the class's docstring.
 73        """
 74        if self.message:
 75            return self.message
 76
 77        return self.__doc__.split("\n")[0] if self.__doc__ else ""
 78
 79    def __str__(self) -> str:
 80        special_properties = ["message", "guidance", "help_url", "log_text", "context"]
 81        display_properties = {
 82            k: v
 83            for k, v in self.__dict__.items()
 84            if k not in special_properties and not k.startswith("_") and v is not None
 85        }
 86        display_properties.update(self.context or {})
 87        context_str = "\n    ".join(
 88            f"{str(k).replace('_', ' ').title()}: {v!r}" for k, v in display_properties.items()
 89        )
 90        exception_str = f"{self.__class__.__name__}: {self.get_message()}\n"
 91        if context_str:
 92            exception_str += "    " + context_str
 93
 94        if self.log_text:
 95            if isinstance(self.log_text, list):
 96                self.log_text = "\n".join(self.log_text)
 97
 98            exception_str += f"\nLog output: \n    {indent(self.log_text, '    ')}"
 99
100        if self.guidance:
101            exception_str += f"\nSuggestion: {self.guidance}"
102
103        if self.help_url:
104            exception_str += f"\nMore info: {self.help_url}"
105
106        return exception_str
107
108    def __repr__(self) -> str:
109        class_name = self.__class__.__name__
110        properties_str = ", ".join(
111            f"{k}={v!r}" for k, v in self.__dict__.items() if not k.startswith("_")
112        )
113        return f"{class_name}({properties_str})"
114
115    def safe_logging_dict(self) -> dict[str, Any]:
116        """Return a dictionary of the exception's properties which is safe for logging.
117
118        We avoid any properties which could potentially contain PII.
119        """
120        result = {
121            # The class name is safe to log:
122            "class": self.__class__.__name__,
123            # We discourage interpolated strings in 'message' so that this should never contain PII:
124            "message": self.get_message(),
125        }
126        safe_attrs = ["connector_name", "stream_name", "violation", "exit_code"]
127        for attr in safe_attrs:
128            if hasattr(self, attr):
129                result[attr] = getattr(self, attr)
130
131        return result
132
133
134# PyAirbyte Internal Errors (these are probably bugs)
135
136
137@dataclass
138class PyAirbyteInternalError(PyAirbyteError):
139    """An internal error occurred in PyAirbyte."""
140
141    guidance = "Please consider reporting this error to the Airbyte team."
142    help_url = NEW_ISSUE_URL
143
144
145# PyAirbyte Input Errors (replaces ValueError for user input)
146
147
148@dataclass
149class PyAirbyteInputError(PyAirbyteError, ValueError):
150    """The input provided to PyAirbyte did not match expected validation rules.
151
152    This inherits from ValueError so that it can be used as a drop-in replacement for
153    ValueError in the PyAirbyte API.
154    """
155
156    # TODO: Consider adding a help_url that links to the auto-generated API reference.
157
158    guidance = "Please check the provided value and try again."
159    input_value: str | None = None
160
161
162@dataclass
163class PyAirbyteNoStreamsSelectedError(PyAirbyteInputError):
164    """No streams were selected for the source."""
165
166    guidance = (
167        "Please call `select_streams()` to select at least one stream from the list provided. "
168        "You can also call `select_all_streams()` to select all available streams for this source."
169    )
170    connector_name: str | None = None
171    available_streams: list[str] | None = None
172
173
174# PyAirbyte Cache Errors
175
176
177class PyAirbyteCacheError(PyAirbyteError):
178    """Error occurred while accessing the cache."""
179
180
181@dataclass
182class PyAirbyteCacheTableValidationError(PyAirbyteCacheError):
183    """Cache table validation failed."""
184
185    violation: str | None = None
186
187
188@dataclass
189class AirbyteConnectorConfigurationMissingError(PyAirbyteCacheError):
190    """Connector is missing configuration."""
191
192    connector_name: str | None = None
193
194
195# Subprocess Errors
196
197
198@dataclass
199class AirbyteSubprocessError(PyAirbyteError):
200    """Error when running subprocess."""
201
202    run_args: list[str] | None = None
203
204
205@dataclass
206class AirbyteSubprocessFailedError(AirbyteSubprocessError):
207    """Subprocess failed."""
208
209    exit_code: int | None = None
210
211
212# Connector Registry Errors
213
214
215class AirbyteConnectorRegistryError(PyAirbyteError):
216    """Error when accessing the connector registry."""
217
218
219@dataclass
220class AirbyteConnectorNotRegisteredError(AirbyteConnectorRegistryError):
221    """Connector not found in registry."""
222
223    connector_name: str | None = None
224    guidance = "Please double check the connector name."
225
226
227@dataclass
228class AirbyteConnectorNotPyPiPublishedError(AirbyteConnectorRegistryError):
229    """Connector found, but not published to PyPI."""
230
231    connector_name: str | None = None
232    guidance = "This likely means that the connector is not ready for use with PyAirbyte."
233
234
235# Connector Errors
236
237
238@dataclass
239class AirbyteConnectorError(PyAirbyteError):
240    """Error when running the connector."""
241
242    connector_name: str | None = None
243
244
245class AirbyteConnectorExecutableNotFoundError(AirbyteConnectorError):
246    """Connector executable not found."""
247
248
249class AirbyteConnectorInstallationError(AirbyteConnectorError):
250    """Error when installing the connector."""
251
252
253class AirbyteConnectorReadError(AirbyteConnectorError):
254    """Error when reading from the connector."""
255
256
257class AirbyteNoDataFromConnectorError(AirbyteConnectorError):
258    """No data was provided from the connector."""
259
260
261class AirbyteConnectorMissingCatalogError(AirbyteConnectorError):
262    """Connector did not return a catalog."""
263
264
265class AirbyteConnectorMissingSpecError(AirbyteConnectorError):
266    """Connector did not return a spec."""
267
268
269class AirbyteConnectorValidationFailedError(AirbyteConnectorError):
270    """Connector config validation failed."""
271
272    guidance = (
273        "Please double-check your config and review the validation errors for more information."
274    )
275
276
277class AirbyteConnectorCheckFailedError(AirbyteConnectorError):
278    """Connector check failed."""
279
280    guidance = (
281        "Please double-check your config or review the connector's logs for more information."
282    )
283
284
285@dataclass
286class AirbyteConnectorFailedError(AirbyteConnectorError):
287    """Connector failed."""
288
289    exit_code: int | None = None
290
291
292@dataclass
293class AirbyteStreamNotFoundError(AirbyteConnectorError):
294    """Connector stream not found."""
295
296    stream_name: str | None = None
297    available_streams: list[str] | None = None
298
299
300@dataclass
301class PyAirbyteSecretNotFoundError(PyAirbyteError):
302    """Secret not found."""
303
304    guidance = "Please ensure that the secret is set."
305    help_url = (
306        "https://docs.airbyte.com/using-airbyte/airbyte-lib/getting-started#secrets-management"
307    )
308
309    secret_name: str | None = None
310    sources: list[str] | None = None
311
312
313# Airbyte API Errors
314
315
316@dataclass
317class AirbyteError(PyAirbyteError):
318    """An error occurred while communicating with the hosted Airbyte instance."""
319
320    response: AirbyteApiResponseDuckType | None = None
321    """The API response from the failed request."""
322
323    workspace: CloudWorkspace | None = None
324    """The workspace where the error occurred."""
325
326    @property
327    def workspace_url(self) -> str | None:
328        if self.workspace:
329            return self.workspace.workspace_url
330
331        return None
332
333
334@dataclass
335class AirbyteConnectionError(AirbyteError):
336    """An connection error occurred while communicating with the hosted Airbyte instance."""
337
338    connection_id: str | None = None
339    """The connection ID where the error occurred."""
340
341    job_id: str | None = None
342    """The job ID where the error occurred (if applicable)."""
343
344    job_status: str | None = None
345    """The latest status of the job where the error occurred (if applicable)."""
346
347    @property
348    def connection_url(self) -> str | None:
349        if self.workspace_url and self.connection_id:
350            return f"{self.workspace_url}/connections/{self.connection_id}"
351
352        return None
353
354    @property
355    def job_history_url(self) -> str | None:
356        if self.connection_url:
357            return f"{self.connection_url}/job-history"
358
359        return None
360
361    @property
362    def job_url(self) -> str | None:
363        if self.job_history_url and self.job_id:
364            return f"{self.job_history_url}#{self.job_id}::0"
365
366        return None
367
368
369@dataclass
370class AirbyteConnectionSyncError(AirbyteConnectionError):
371    """An error occurred while executing the remote Airbyte job."""
372
373
374@dataclass
375class AirbyteConnectionSyncTimeoutError(AirbyteConnectionSyncError):
376    """An timeout occurred while waiting for the remote Airbyte job to complete."""
377
378    timeout: int | None = None
379    """The timeout in seconds that was reached."""
380
381
382# Airbyte Resource Errors (General)
383
384
385@dataclass
386class AirbyteMissingResourceError(AirbyteError):
387    """Remote Airbyte resources does not exist."""
388
389    resource_type: str | None = None
390    resource_name_or_id: str | None = None
391
392
393@dataclass
394class AirbyteMultipleResourcesError(AirbyteError):
395    """Could not locate the resource because multiple matching resources were found."""
396
397    resource_type: str | None = None
398    resource_name_or_id: str | None = None
NEW_ISSUE_URL = 'https://github.com/airbytehq/airbyte/issues/new/choose'
DOCS_URL = 'https://docs.airbyte.io/'
@dataclass
class PyAirbyteError(builtins.Exception):
 58@dataclass
 59class PyAirbyteError(Exception):
 60    """Base class for exceptions in Airbyte."""
 61
 62    guidance: str | None = None
 63    help_url: str | None = None
 64    log_text: str | list[str] | None = None
 65    context: dict[str, Any] | None = None
 66    message: str | None = None
 67
 68    def get_message(self) -> str:
 69        """Return the best description for the exception.
 70
 71        We resolve the following in order:
 72        1. The message sent to the exception constructor (if provided).
 73        2. The first line of the class's docstring.
 74        """
 75        if self.message:
 76            return self.message
 77
 78        return self.__doc__.split("\n")[0] if self.__doc__ else ""
 79
 80    def __str__(self) -> str:
 81        special_properties = ["message", "guidance", "help_url", "log_text", "context"]
 82        display_properties = {
 83            k: v
 84            for k, v in self.__dict__.items()
 85            if k not in special_properties and not k.startswith("_") and v is not None
 86        }
 87        display_properties.update(self.context or {})
 88        context_str = "\n    ".join(
 89            f"{str(k).replace('_', ' ').title()}: {v!r}" for k, v in display_properties.items()
 90        )
 91        exception_str = f"{self.__class__.__name__}: {self.get_message()}\n"
 92        if context_str:
 93            exception_str += "    " + context_str
 94
 95        if self.log_text:
 96            if isinstance(self.log_text, list):
 97                self.log_text = "\n".join(self.log_text)
 98
 99            exception_str += f"\nLog output: \n    {indent(self.log_text, '    ')}"
100
101        if self.guidance:
102            exception_str += f"\nSuggestion: {self.guidance}"
103
104        if self.help_url:
105            exception_str += f"\nMore info: {self.help_url}"
106
107        return exception_str
108
109    def __repr__(self) -> str:
110        class_name = self.__class__.__name__
111        properties_str = ", ".join(
112            f"{k}={v!r}" for k, v in self.__dict__.items() if not k.startswith("_")
113        )
114        return f"{class_name}({properties_str})"
115
116    def safe_logging_dict(self) -> dict[str, Any]:
117        """Return a dictionary of the exception's properties which is safe for logging.
118
119        We avoid any properties which could potentially contain PII.
120        """
121        result = {
122            # The class name is safe to log:
123            "class": self.__class__.__name__,
124            # We discourage interpolated strings in 'message' so that this should never contain PII:
125            "message": self.get_message(),
126        }
127        safe_attrs = ["connector_name", "stream_name", "violation", "exit_code"]
128        for attr in safe_attrs:
129            if hasattr(self, attr):
130                result[attr] = getattr(self, attr)
131
132        return result

Base class for exceptions in Airbyte.

PyAirbyteError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None)
guidance: str | None = None
help_url: str | None = None
log_text: str | list[str] | None = None
context: dict[str, typing.Any] | None = None
message: str | None = None
def get_message(self) -> str:
68    def get_message(self) -> str:
69        """Return the best description for the exception.
70
71        We resolve the following in order:
72        1. The message sent to the exception constructor (if provided).
73        2. The first line of the class's docstring.
74        """
75        if self.message:
76            return self.message
77
78        return self.__doc__.split("\n")[0] if self.__doc__ else ""

Return the best description for the exception.

We resolve the following in order:

  1. The message sent to the exception constructor (if provided).
  2. The first line of the class's docstring.
def safe_logging_dict(self) -> dict[str, typing.Any]:
116    def safe_logging_dict(self) -> dict[str, Any]:
117        """Return a dictionary of the exception's properties which is safe for logging.
118
119        We avoid any properties which could potentially contain PII.
120        """
121        result = {
122            # The class name is safe to log:
123            "class": self.__class__.__name__,
124            # We discourage interpolated strings in 'message' so that this should never contain PII:
125            "message": self.get_message(),
126        }
127        safe_attrs = ["connector_name", "stream_name", "violation", "exit_code"]
128        for attr in safe_attrs:
129            if hasattr(self, attr):
130                result[attr] = getattr(self, attr)
131
132        return result

Return a dictionary of the exception's properties which is safe for logging.

We avoid any properties which could potentially contain PII.

Inherited Members
builtins.BaseException
with_traceback
args
@dataclass
class PyAirbyteInternalError(PyAirbyteError):
138@dataclass
139class PyAirbyteInternalError(PyAirbyteError):
140    """An internal error occurred in PyAirbyte."""
141
142    guidance = "Please consider reporting this error to the Airbyte team."
143    help_url = NEW_ISSUE_URL

An internal error occurred in PyAirbyte.

PyAirbyteInternalError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None)
guidance = 'Please consider reporting this error to the Airbyte team.'
help_url = 'https://github.com/airbytehq/airbyte/issues/new/choose'
Inherited Members
PyAirbyteError
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
@dataclass
class PyAirbyteInputError(PyAirbyteError, builtins.ValueError):
149@dataclass
150class PyAirbyteInputError(PyAirbyteError, ValueError):
151    """The input provided to PyAirbyte did not match expected validation rules.
152
153    This inherits from ValueError so that it can be used as a drop-in replacement for
154    ValueError in the PyAirbyte API.
155    """
156
157    # TODO: Consider adding a help_url that links to the auto-generated API reference.
158
159    guidance = "Please check the provided value and try again."
160    input_value: str | None = None

The input provided to PyAirbyte did not match expected validation rules.

This inherits from ValueError so that it can be used as a drop-in replacement for ValueError in the PyAirbyte API.

PyAirbyteInputError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, input_value: str | None = None)
guidance = 'Please check the provided value and try again.'
input_value: str | None = None
Inherited Members
PyAirbyteError
help_url
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
@dataclass
class PyAirbyteNoStreamsSelectedError(PyAirbyteInputError):
163@dataclass
164class PyAirbyteNoStreamsSelectedError(PyAirbyteInputError):
165    """No streams were selected for the source."""
166
167    guidance = (
168        "Please call `select_streams()` to select at least one stream from the list provided. "
169        "You can also call `select_all_streams()` to select all available streams for this source."
170    )
171    connector_name: str | None = None
172    available_streams: list[str] | None = None

No streams were selected for the source.

PyAirbyteNoStreamsSelectedError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, input_value: str | None = None, connector_name: str | None = None, available_streams: list[str] | None = None)
guidance = 'Please call `select_streams()` to select at least one stream from the list provided. You can also call `select_all_streams()` to select all available streams for this source.'
connector_name: str | None = None
available_streams: list[str] | None = None
Inherited Members
PyAirbyteInputError
input_value
PyAirbyteError
help_url
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
class PyAirbyteCacheError(PyAirbyteError):
178class PyAirbyteCacheError(PyAirbyteError):
179    """Error occurred while accessing the cache."""

Error occurred while accessing the cache.

Inherited Members
PyAirbyteError
PyAirbyteError
guidance
help_url
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
@dataclass
class PyAirbyteCacheTableValidationError(PyAirbyteCacheError):
182@dataclass
183class PyAirbyteCacheTableValidationError(PyAirbyteCacheError):
184    """Cache table validation failed."""
185
186    violation: str | None = None

Cache table validation failed.

PyAirbyteCacheTableValidationError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, violation: str | None = None)
violation: str | None = None
Inherited Members
PyAirbyteError
guidance
help_url
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
@dataclass
class AirbyteConnectorConfigurationMissingError(PyAirbyteCacheError):
189@dataclass
190class AirbyteConnectorConfigurationMissingError(PyAirbyteCacheError):
191    """Connector is missing configuration."""
192
193    connector_name: str | None = None

Connector is missing configuration.

AirbyteConnectorConfigurationMissingError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, connector_name: str | None = None)
connector_name: str | None = None
Inherited Members
PyAirbyteError
guidance
help_url
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
@dataclass
class AirbyteSubprocessError(PyAirbyteError):
199@dataclass
200class AirbyteSubprocessError(PyAirbyteError):
201    """Error when running subprocess."""
202
203    run_args: list[str] | None = None

Error when running subprocess.

AirbyteSubprocessError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, run_args: list[str] | None = None)
run_args: list[str] | None = None
Inherited Members
PyAirbyteError
guidance
help_url
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
@dataclass
class AirbyteSubprocessFailedError(AirbyteSubprocessError):
206@dataclass
207class AirbyteSubprocessFailedError(AirbyteSubprocessError):
208    """Subprocess failed."""
209
210    exit_code: int | None = None

Subprocess failed.

AirbyteSubprocessFailedError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, run_args: list[str] | None = None, exit_code: int | None = None)
exit_code: int | None = None
class AirbyteConnectorRegistryError(PyAirbyteError):
216class AirbyteConnectorRegistryError(PyAirbyteError):
217    """Error when accessing the connector registry."""

Error when accessing the connector registry.

Inherited Members
PyAirbyteError
PyAirbyteError
guidance
help_url
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
@dataclass
class AirbyteConnectorNotRegisteredError(AirbyteConnectorRegistryError):
220@dataclass
221class AirbyteConnectorNotRegisteredError(AirbyteConnectorRegistryError):
222    """Connector not found in registry."""
223
224    connector_name: str | None = None
225    guidance = "Please double check the connector name."

Connector not found in registry.

AirbyteConnectorNotRegisteredError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, connector_name: str | None = None)
connector_name: str | None = None
guidance = 'Please double check the connector name.'
Inherited Members
PyAirbyteError
help_url
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
@dataclass
class AirbyteConnectorNotPyPiPublishedError(AirbyteConnectorRegistryError):
228@dataclass
229class AirbyteConnectorNotPyPiPublishedError(AirbyteConnectorRegistryError):
230    """Connector found, but not published to PyPI."""
231
232    connector_name: str | None = None
233    guidance = "This likely means that the connector is not ready for use with PyAirbyte."

Connector found, but not published to PyPI.

AirbyteConnectorNotPyPiPublishedError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, connector_name: str | None = None)
connector_name: str | None = None
guidance = 'This likely means that the connector is not ready for use with PyAirbyte.'
Inherited Members
PyAirbyteError
help_url
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
@dataclass
class AirbyteConnectorError(PyAirbyteError):
239@dataclass
240class AirbyteConnectorError(PyAirbyteError):
241    """Error when running the connector."""
242
243    connector_name: str | None = None

Error when running the connector.

AirbyteConnectorError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, connector_name: str | None = None)
connector_name: str | None = None
Inherited Members
PyAirbyteError
guidance
help_url
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
class AirbyteConnectorExecutableNotFoundError(AirbyteConnectorError):
246class AirbyteConnectorExecutableNotFoundError(AirbyteConnectorError):
247    """Connector executable not found."""

Connector executable not found.

class AirbyteConnectorInstallationError(AirbyteConnectorError):
250class AirbyteConnectorInstallationError(AirbyteConnectorError):
251    """Error when installing the connector."""

Error when installing the connector.

class AirbyteConnectorReadError(AirbyteConnectorError):
254class AirbyteConnectorReadError(AirbyteConnectorError):
255    """Error when reading from the connector."""

Error when reading from the connector.

class AirbyteNoDataFromConnectorError(AirbyteConnectorError):
258class AirbyteNoDataFromConnectorError(AirbyteConnectorError):
259    """No data was provided from the connector."""

No data was provided from the connector.

class AirbyteConnectorMissingCatalogError(AirbyteConnectorError):
262class AirbyteConnectorMissingCatalogError(AirbyteConnectorError):
263    """Connector did not return a catalog."""

Connector did not return a catalog.

class AirbyteConnectorMissingSpecError(AirbyteConnectorError):
266class AirbyteConnectorMissingSpecError(AirbyteConnectorError):
267    """Connector did not return a spec."""

Connector did not return a spec.

class AirbyteConnectorValidationFailedError(AirbyteConnectorError):
270class AirbyteConnectorValidationFailedError(AirbyteConnectorError):
271    """Connector config validation failed."""
272
273    guidance = (
274        "Please double-check your config and review the validation errors for more information."
275    )

Connector config validation failed.

guidance = 'Please double-check your config and review the validation errors for more information.'
class AirbyteConnectorCheckFailedError(AirbyteConnectorError):
278class AirbyteConnectorCheckFailedError(AirbyteConnectorError):
279    """Connector check failed."""
280
281    guidance = (
282        "Please double-check your config or review the connector's logs for more information."
283    )

Connector check failed.

guidance = "Please double-check your config or review the connector's logs for more information."
@dataclass
class AirbyteConnectorFailedError(AirbyteConnectorError):
286@dataclass
287class AirbyteConnectorFailedError(AirbyteConnectorError):
288    """Connector failed."""
289
290    exit_code: int | None = None

Connector failed.

AirbyteConnectorFailedError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, connector_name: str | None = None, exit_code: int | None = None)
exit_code: int | None = None
@dataclass
class AirbyteStreamNotFoundError(AirbyteConnectorError):
293@dataclass
294class AirbyteStreamNotFoundError(AirbyteConnectorError):
295    """Connector stream not found."""
296
297    stream_name: str | None = None
298    available_streams: list[str] | None = None

Connector stream not found.

AirbyteStreamNotFoundError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, connector_name: str | None = None, stream_name: str | None = None, available_streams: list[str] | None = None)
stream_name: str | None = None
available_streams: list[str] | None = None
@dataclass
class PyAirbyteSecretNotFoundError(PyAirbyteError):
301@dataclass
302class PyAirbyteSecretNotFoundError(PyAirbyteError):
303    """Secret not found."""
304
305    guidance = "Please ensure that the secret is set."
306    help_url = (
307        "https://docs.airbyte.com/using-airbyte/airbyte-lib/getting-started#secrets-management"
308    )
309
310    secret_name: str | None = None
311    sources: list[str] | None = None

Secret not found.

PyAirbyteSecretNotFoundError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, secret_name: str | None = None, sources: list[str] | None = None)
guidance = 'Please ensure that the secret is set.'
help_url = 'https://docs.airbyte.com/using-airbyte/airbyte-lib/getting-started#secrets-management'
secret_name: str | None = None
sources: list[str] | None = None
Inherited Members
PyAirbyteError
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
@dataclass
class AirbyteError(PyAirbyteError):
317@dataclass
318class AirbyteError(PyAirbyteError):
319    """An error occurred while communicating with the hosted Airbyte instance."""
320
321    response: AirbyteApiResponseDuckType | None = None
322    """The API response from the failed request."""
323
324    workspace: CloudWorkspace | None = None
325    """The workspace where the error occurred."""
326
327    @property
328    def workspace_url(self) -> str | None:
329        if self.workspace:
330            return self.workspace.workspace_url
331
332        return None

An error occurred while communicating with the hosted Airbyte instance.

AirbyteError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, response: airbyte._util.api_duck_types.AirbyteApiResponseDuckType | None = None, workspace: airbyte.cloud.workspaces.CloudWorkspace | None = None)
response: airbyte._util.api_duck_types.AirbyteApiResponseDuckType | None = None

The API response from the failed request.

workspace: airbyte.cloud.workspaces.CloudWorkspace | None = None

The workspace where the error occurred.

workspace_url: str | None
327    @property
328    def workspace_url(self) -> str | None:
329        if self.workspace:
330            return self.workspace.workspace_url
331
332        return None
Inherited Members
PyAirbyteError
guidance
help_url
log_text
context
message
get_message
safe_logging_dict
builtins.BaseException
with_traceback
args
@dataclass
class AirbyteConnectionError(AirbyteError):
335@dataclass
336class AirbyteConnectionError(AirbyteError):
337    """An connection error occurred while communicating with the hosted Airbyte instance."""
338
339    connection_id: str | None = None
340    """The connection ID where the error occurred."""
341
342    job_id: str | None = None
343    """The job ID where the error occurred (if applicable)."""
344
345    job_status: str | None = None
346    """The latest status of the job where the error occurred (if applicable)."""
347
348    @property
349    def connection_url(self) -> str | None:
350        if self.workspace_url and self.connection_id:
351            return f"{self.workspace_url}/connections/{self.connection_id}"
352
353        return None
354
355    @property
356    def job_history_url(self) -> str | None:
357        if self.connection_url:
358            return f"{self.connection_url}/job-history"
359
360        return None
361
362    @property
363    def job_url(self) -> str | None:
364        if self.job_history_url and self.job_id:
365            return f"{self.job_history_url}#{self.job_id}::0"
366
367        return None

An connection error occurred while communicating with the hosted Airbyte instance.

AirbyteConnectionError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, response: airbyte._util.api_duck_types.AirbyteApiResponseDuckType | None = None, workspace: airbyte.cloud.workspaces.CloudWorkspace | None = None, connection_id: str | None = None, job_id: str | None = None, job_status: str | None = None)
connection_id: str | None = None

The connection ID where the error occurred.

job_id: str | None = None

The job ID where the error occurred (if applicable).

job_status: str | None = None

The latest status of the job where the error occurred (if applicable).

connection_url: str | None
348    @property
349    def connection_url(self) -> str | None:
350        if self.workspace_url and self.connection_id:
351            return f"{self.workspace_url}/connections/{self.connection_id}"
352
353        return None
job_history_url: str | None
355    @property
356    def job_history_url(self) -> str | None:
357        if self.connection_url:
358            return f"{self.connection_url}/job-history"
359
360        return None
job_url: str | None
362    @property
363    def job_url(self) -> str | None:
364        if self.job_history_url and self.job_id:
365            return f"{self.job_history_url}#{self.job_id}::0"
366
367        return None
@dataclass
class AirbyteConnectionSyncError(AirbyteConnectionError):
370@dataclass
371class AirbyteConnectionSyncError(AirbyteConnectionError):
372    """An error occurred while executing the remote Airbyte job."""

An error occurred while executing the remote Airbyte job.

AirbyteConnectionSyncError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, response: airbyte._util.api_duck_types.AirbyteApiResponseDuckType | None = None, workspace: airbyte.cloud.workspaces.CloudWorkspace | None = None, connection_id: str | None = None, job_id: str | None = None, job_status: str | None = None)
@dataclass
class AirbyteConnectionSyncTimeoutError(AirbyteConnectionSyncError):
375@dataclass
376class AirbyteConnectionSyncTimeoutError(AirbyteConnectionSyncError):
377    """An timeout occurred while waiting for the remote Airbyte job to complete."""
378
379    timeout: int | None = None
380    """The timeout in seconds that was reached."""

An timeout occurred while waiting for the remote Airbyte job to complete.

AirbyteConnectionSyncTimeoutError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, response: airbyte._util.api_duck_types.AirbyteApiResponseDuckType | None = None, workspace: airbyte.cloud.workspaces.CloudWorkspace | None = None, connection_id: str | None = None, job_id: str | None = None, job_status: str | None = None, timeout: int | None = None)
timeout: int | None = None

The timeout in seconds that was reached.

@dataclass
class AirbyteMissingResourceError(AirbyteError):
386@dataclass
387class AirbyteMissingResourceError(AirbyteError):
388    """Remote Airbyte resources does not exist."""
389
390    resource_type: str | None = None
391    resource_name_or_id: str | None = None

Remote Airbyte resources does not exist.

AirbyteMissingResourceError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, response: airbyte._util.api_duck_types.AirbyteApiResponseDuckType | None = None, workspace: airbyte.cloud.workspaces.CloudWorkspace | None = None, resource_type: str | None = None, resource_name_or_id: str | None = None)
resource_type: str | None = None
resource_name_or_id: str | None = None
@dataclass
class AirbyteMultipleResourcesError(AirbyteError):
394@dataclass
395class AirbyteMultipleResourcesError(AirbyteError):
396    """Could not locate the resource because multiple matching resources were found."""
397
398    resource_type: str | None = None
399    resource_name_or_id: str | None = None

Could not locate the resource because multiple matching resources were found.

AirbyteMultipleResourcesError( guidance: str | None = None, help_url: str | None = None, log_text: str | list[str] | None = None, context: dict[str, typing.Any] | None = None, message: str | None = None, response: airbyte._util.api_duck_types.AirbyteApiResponseDuckType | None = None, workspace: airbyte.cloud.workspaces.CloudWorkspace | None = None, resource_type: str | None = None, resource_name_or_id: str | None = None)
resource_type: str | None = None
resource_name_or_id: str | None = None