Deprecate/remove/rename {{ drop_relation() }}, either by calling dispatch directly in the adapter method or renaming this macro so that it is more clearly returning adapter.dispatch(DROP_RELATION_MACRO_NAME) and not a macro that should be called directly
Adapter maintainers and users should always call either:
adapter.drop_relation
drop_relation_if_exists
(syntactic sugar that checks cache first, and then callsadapter.drop_relation
)Why? Calling
{{ drop_relation() }}
directly does not update the cache!! That happens within the adapterdrop_relation
method here:https://github.com/dbt-labs/dbt-adapters/blob/a2292c8ec76e4c9f03869ad95817a2ad82dfb34b/dbt/adapters/sql/impl.py#L140-L145
Even though this method ultimately shells out to a macro called
{{ drop_relation() }}
:https://github.com/dbt-labs/dbt-adapters/blob/a2292c8ec76e4c9f03869ad95817a2ad82dfb34b/dbt/include/global_project/macros/relations/drop.sql#L26-L34
Proposals
{{ drop_relation() }}
, either by callingdispatch
directly in the adapter method or renaming this macro so that it is more clearly returningadapter.dispatch(DROP_RELATION_MACRO_NAME)
and not a macro that should be called directly