dbt-labs / dbt-adapters

Apache License 2.0
14 stars 17 forks source link

[Bug] dbt failing without an implementation for abstract method `get_catalog_for_single_relation` #239

Open tuliolima opened 2 weeks ago

tuliolima commented 2 weeks ago

Is this a new bug?

Current Behavior

We were running dbt with dbt-core==1.8.2 in a docker image with no problems, but recently it started to fail with the error:

  File "/usr/local/lib/python3.12/site-packages/dbt/adapters/factory.py", line 118, in register_adapter
    adapter: Adapter = adapter_type(config, mp_context)  # type: ignore
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Can't instantiate abstract class BigQueryAdapter without an implementation for abstract method 'get_catalog_for_single_relation'

Looking at the docker build logs we see that it was installing dbt_adapters-1.2.1 but now it started to install dbt_adapters-1.3.0, which was release 1 hour ago. One PR related to get_catalog_for_single_relation was merged a few hours ago, what can be related to this error.

Can someone help clarify what is happening?

requirements.txt:

dbt-core==1.8.2
dbt-bigquery==1.8.1
markupsafe==2.1.2
sqlfluff==3.0.7
sqlfluff-templater-dbt==3.0.7
elementary-data[bigquery]==0.15.1

Dockerfile:

FROM python:3.12.4

WORKDIR /code

COPY . .

RUN pip install -r requirements.txt

RUN dbt deps

Expected Behavior

It is expected to run all dbt commands with no problems.

Steps To Reproduce

Run any dbt command with this configs.

Relevant log output

22:49:13  Running with dbt=1.8.2
22:49:15  Registered adapter: bigquery=1.8.1
22:49:15  Encountered an error:
Can't instantiate abstract class BigQueryAdapter without an implementation for abstract method 'get_catalog_for_single_relation'
22:49:15  Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/dbt/cli/requires.py", line 138, in wrapper
    result, success = func(*args, **kwargs)
                      ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/dbt/cli/requires.py", line 101, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/dbt/cli/requires.py", line 218, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/dbt/cli/requires.py", line 247, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/dbt/cli/requires.py", line [29](https://gitlab.com/brasil-paralelo-2019/data-projects/bp-dbt-dw/-/jobs/7131408631#L29)4, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/dbt/cli/requires.py", line 320, in wrapper
    ctx.obj["manifest"] = parse_manifest(
                          ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/dbt/parser/manifest.py", line 1895, in parse_manifest
    register_adapter(runtime_config, get_mp_context())
  File "/usr/local/lib/python3.12/site-packages/dbt/adapters/factory.py", line 203, in register_adapter
    FACTORY.register_adapter(config, mp_context, adapter_registered_log_level)
  File "/usr/local/lib/python3.12/site-packages/dbt/adapters/factory.py", line 118, in register_adapter
    adapter: Adapter = adapter_type(config, mp_context)  # type: ignore
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Can't instantiate abstract class BigQueryAdapter without an implementation for abstract method 'get_catalog_for_single_relation'

Environment

- OS: Docker image python:3.12.4
- Python: 3.12.4
- dbt-adapters: 1.3.0

Additional Context

No response

tuliolima commented 2 weeks ago

Hey, @aranke. Do you know if your PR will fix this issue?