diff --git a/ibis/backends/__init__.py b/ibis/backends/__init__.py index 20973d265b278..f31228b949bf1 100644 --- a/ibis/backends/__init__.py +++ b/ibis/backends/__init__.py @@ -7,6 +7,7 @@ import keyword import re import urllib.parse +import weakref from pathlib import Path from typing import TYPE_CHECKING, Any, ClassVar @@ -114,7 +115,7 @@ def _ipython_key_completions_(self) -> list[str]: class DDLAccessor: """ddl accessor list views.""" - def __init__(self, backend: BaseBackend): + def __init__(self, backend: weakref.proxy): self._backend = backend def _raise_if_not_implemented(self, method_name: str): @@ -1051,7 +1052,7 @@ def tables(self): @functools.cached_property def ddl(self): """A ddl accessor.""" - return DDLAccessor(self) + return DDLAccessor(weakref.proxy(self)) @property @abc.abstractmethod