Skip to content

Commit

Permalink
fix circular import loop
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers committed Aug 5, 2024
1 parent a671c97 commit 34acdda
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions airbyte/_util/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@

from airbyte import exceptions as exc
from airbyte._util import meta
from airbyte.destinations.base import Destination
from airbyte.version import get_version
from airbyte.writers import AirbyteWriterInterface


if TYPE_CHECKING:
from airbyte.caches.base import CacheBase
from airbyte.destinations.base import Destination
from airbyte.sources.base import Source
from airbyte.writers import AirbyteWriterInterface


DEBUG = True
Expand Down Expand Up @@ -237,21 +237,13 @@ def from_destination(
if isinstance(destination, str):
return cls(name=destination, executor_type=UNKNOWN, version=UNKNOWN)

if isinstance(destination, Destination):
if hasattr(destination, "executor"):
return cls(
name=destination.name,
executor_type=type(destination.executor).__name__,
version=destination.executor.reported_version,
)

# Else, `destination` should be a `AirbyteWriterInterface` at this point
if isinstance(destination, AirbyteWriterInterface):
return cls(
name=destination.name,
executor_type=UNKNOWN,
version=UNKNOWN,
)

return cls( # type: ignore [unreachable]
name=repr(destination),
executor_type=UNKNOWN,
Expand Down

0 comments on commit 34acdda

Please sign in to comment.