Skip to content

Commit d1d12d6

Browse files
authored
Fix: Method to_sql_table() fails when called from cached dataset (#76)
1 parent 8ebc28f commit d1d12d6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

airbyte/datasets/_sql.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,12 @@ def __init__(
123123

124124
@overrides
125125
def to_pandas(self) -> DataFrame:
126+
"""Return the underlying dataset data as a pandas DataFrame."""
126127
return self._cache.processor.get_pandas_dataframe(self._stream_name)
127128

128129
def to_sql_table(self) -> Table:
129-
if self._sql_table is None:
130-
self._sql_table: Table = self._cache.processor.get_sql_table(self.stream_name)
131-
132-
return self._sql_table
130+
"""Return the underlying SQL table as a SQLAlchemy Table object."""
131+
return self._cache.processor.get_sql_table(self.stream_name)
133132

134133
def __eq__(self, value: object) -> bool:
135134
"""Return True if the value is a CachedDataset with the same cache and stream name.

0 commit comments

Comments
 (0)