From 34acdda406a2987f4c1619d07bd891dfb498b99d Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Mon, 5 Aug 2024 13:58:05 -0700 Subject: [PATCH] fix circular import loop --- airbyte/_util/telemetry.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/airbyte/_util/telemetry.py b/airbyte/_util/telemetry.py index faa276b8..7f64bf2d 100644 --- a/airbyte/_util/telemetry.py +++ b/airbyte/_util/telemetry.py @@ -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 @@ -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,