Skip to content

[Bug] dbt-athena is compiling non-specified sources  #748

Description

@soham-dasgupta

Is this a new bug in dbt-athena?

  • I believe this is a new bug in dbt-athena
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

I have two major databases in my dbt project sources - Athena and Trino and two targets in projects profiles as shown below

version: 2

sources:
  - name: trino
    database: trino
    schema: trino_prod
    tables:
      - name: xxxxxx
  - name: athena
    database: AwsDataCatalog
    schema: athena
    tables:
      - name: xxxxx
      - 
trino:
  target: prod
  outputs:
    prod:
      type: trino
      host: xxx.xxx.xxx.xxx
      user: xxx
      password: xxx
      catalog: xxx
      port: 8080
      schema: xxx
      threads: 1
      method: ldap
      http_scheme: https
athena:
  target: prod
  outputs:
    prod:
      type: athena
      region_name: us-east-1
      schema: xxx
      database: awsdatacatalog
      aws_profile_name: xxx-xxx-xxx
      work_group: xxx-xx-xxx
      s3_staging_dir: s3://xxx
      s3_data_dir: s3://xxxx/xxx
      s3_data_naming: table
      s3_tmp_table_dir: s3://xxxxxx
      poll_interval: 10

I can use dbt docs generate --select "source:trino" --profile trino to limit generating documentation for trino but I can't do the same for dbt docs generate --select "source:athena" --profile athena as this leads to generating documentation for source:trino ultimately leading to failure

13:26:16  Encountered an error while generating catalog: An error occurred (InvalidRequestException) when calling the GetDataCatalog operation: DataCatalog xxxxxx_xxxx was not found.
13:26:16  Encountered an error while generating catalog: An error occurred (InvalidRequestException) when calling the GetDataCatalog operation: DataCatalog xxxxxxxx_xxxx_xxxxxx was not found.

Expected Behavior

When I run dbt docs generate --select "source:athena" --profile athena I would like to generate the documentation for objects that depend on "source:athena"

Steps To Reproduce

  1. Create a sources.yml that has Athena and Trino sources
  2. Create a profiles.yml that has Athena and Trino targets
  3. Run dbt docs generate --select "source:athena" --profile athena and it tries to generate the metadata for databases accessible via Trino as well.

Relevant log output

13:26:16 Encountered an error while generating catalog: An error occurred (InvalidRequestException) when calling the GetDataCatalog operation: DataCatalog xxxxxx_xxxx was not found.
13:26:16 Encountered an error while generating catalog: An error occurred (InvalidRequestException) when calling the GetDataCatalog operation: DataCatalog xxxxxxxx_xxxx_xxxxxx was not found.

Environment

- OS: AL2
- Python: Python 3.11.11
- dbt-core: 1.7.15
- dbt-athena: 1.7.2
- dbt-trino: 1.7.1

Additional Context

No response

Activity

  1. changed the title [-]dbt docs generate --select "source:athena" --profile athena fails with An error occurred (InvalidRequestException) when calling the GetDataCatalog operation: DataCatalog xxxxxx_xxxx was not found.[/-] [+][Bug] dbt-athena is compiling non-specified sources [/+] on Feb 4, 2025
  2. soham-dasgupta commented on May 22, 2025

    @soham-dasgupta
    Author

    Is there an update on this issue?
    This limits our capability to generate documentation for Athena sources where multiple adapters co exist within the same dbt project

  3. Giqles commented on Jul 29, 2025

    @Giqles

    I have a related issue. dbt docs generate with the dbt-athena adapter seems to try and introspect tables that aren't specified as sources or created in targets by the dbt project, but are in the same (huge) Glue catalog (or at least source schema). And then fails when it encounters issues with permissions to other tables in the Glue catalog that aren't related to the project.

    ❯ dbt docs generate
    14:33:50  Running with dbt=1.10.5
    14:33:51  Registered adapter: athena=1.9.4
    14:33:51  Found 6 models, 21 data tests, 1 seed, 9 sources, 463 macros
    14:33:51  Nothing to do. Try checking your model configs and model specification args
    14:33:51  Building catalog
    14:34:12  Encountered an error while generating catalog: Table type cannot be None for table <TABLE_NOT_RELATED_TO_PROJECT_BUT_IN_SOURCE_SCHEMA>
    14:34:12  dbt encountered 1 failure while writing the catalog

    As a result we also need to run with dbt docs generate --empty-catalog.

  4. soham-dasgupta commented on Jul 30, 2025

    @soham-dasgupta
    Author

    I have a related issue. dbt docs generate with the dbt-athena adapter seems to try and introspect tables that aren't specified as sources or created in targets by the dbt project, but are in the same (huge) Glue catalog (or at least source schema). And then fails when it encounters issues with permissions to other tables in the Glue catalog that aren't related to the project.

    ❯ dbt docs generate
    14:33:50 Running with dbt=1.10.5
    14:33:51 Registered adapter: athena=1.9.4
    14:33:51 Found 6 models, 21 data tests, 1 seed, 9 sources, 463 macros
    14:33:51 Nothing to do. Try checking your model configs and model specification args
    14:33:51 Building catalog
    14:34:12 Encountered an error while generating catalog: Table type cannot be None for table <TABLE_NOT_RELATED_TO_PROJECT_BUT_IN_SOURCE_SCHEMA>
    14:34:12 dbt encountered 1 failure while writing the catalog
    As a result we also need to run with dbt docs generate --empty-catalog.

    This is similar to the issue that I am facing. Its trying to compile non specified sources and thus failing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions