Hi there,
I’m currently working on trying to extend the default Postgres adapter, and trying to just create a child adapter that acts as a pass through class without changing the parent’s functionality doesn’t seem to be working as expected.
I started by using the adapter creation script and the Redshift adapter code as a basis for this new adapter. In the Redshift macros, the Postgres versions of the macros are called explicitly. One example being the create_schema
macro from adapters.sql
{% macro redshift__create_schema(relation) -%}
{{ postgres__create_schema(relation) }}
{% endmacro %}
If I include this in my new adapter named custompostgres
, but change redshift
to custompostgres
, running the dbt adapter test suite fails with the exception:
“Compilation Error in macro custompostgres__create_schema (macros/adapter.sql)
‘postgres__create_schema’ is undefined”
This happens for all tests since most are referencing similarly defined macros somewhere. Running the same test spec file with the default postgres adapter completely passes. I don’t have a redshift cluster to test against, so I don’t know if the redshift adapter passes it.
The custom setup.py file also mimics the Redshift adapter by requiring both dbt
and dbt-postgres
as well as setting packages=find_namespace_packages(include=['dbt', 'dbt.*']),
Any idea on how I can reference the inherited class’s macros, or what I’m likely doing wrong here? Let me know if there are any other details that would help.