Skip to content

Commit 7ca0f3d

Browse files
authored
feat: relax is_table_not_found (#95)
## What's Changed Make it slightly more generally useful.
1 parent 51aebea commit 7ca0f3d

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

adbc_drivers_validation/model.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,19 @@ def drop_table(
222222
return f"DROP TABLE {name}"
223223

224224
@abc.abstractmethod
225-
def is_table_not_found(self, table_name: str, error: Exception) -> bool:
226-
"""Check if the error indicates a table not found."""
225+
def is_table_not_found(self, table_name: str | None, error: Exception) -> bool:
226+
"""
227+
Check if the error indicates a table not found.
228+
229+
Parameters
230+
----------
231+
table_name : str, optional
232+
The table that was expected to not be found. Pass None to only
233+
check if the error was of this general category and not for a
234+
specific table.
235+
error : Exception
236+
The error to check.
237+
"""
227238
...
228239

229240
def qualify_temp_table(

adbc_drivers_validation/tests/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,6 @@ def _setup_query(
208208
cursor.adbc_statement.execute_update()
209209
except adbc_driver_manager.Error as e:
210210
# Some databases have no way to do DROP IF EXISTS
211-
if driver.is_table_not_found(table_name=statement, error=e):
211+
if driver.is_table_not_found(table_name=None, error=e):
212212
continue
213213
raise

0 commit comments

Comments
 (0)