Skip to content

fix(duckdb): ensure drop_table handles views to avoid catalog errors#5695

Open
Retugbo wants to merge 3 commits intoTobikoData:mainfrom
Retugbo:fix/duckdb-drop-view-logic
Open

fix(duckdb): ensure drop_table handles views to avoid catalog errors#5695
Retugbo wants to merge 3 commits intoTobikoData:mainfrom
Retugbo:fix/duckdb-drop-view-logic

Conversation

@Retugbo
Copy link

@Retugbo Retugbo commented Feb 9, 2026

Problem: DuckDB maintains a strict distinction between tables and views in its catalog. Invoking DROP TABLE on a view object currently triggers a Catalog Error.

Solution:
This PR introduces a safety check in the drop_table method:

Metadata Inspection: Leverages _get_data_objects to verify the object type at runtime.

Dynamic Routing: If the object is a VIEW, the call is redirected to drop_view.

Signature Integrity: Maintains compatibility with the EngineAdapter superclass while preventing kwargs collisions (specifically the exists flag).

Impact:
Increases the robustness of the DuckDB adapter, preventing workflow interruptions when models are switched between table and view materializations.

@CLAassistant
Copy link

CLAassistant commented Feb 9, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants