Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Log entries - No external sources selected #310

Open
1 of 3 tasks
ward-resa opened this issue Aug 1, 2024 · 0 comments · May be fixed by #311
Open
1 of 3 tasks

Incorrect Log entries - No external sources selected #310

ward-resa opened this issue Aug 1, 2024 · 0 comments · May be fixed by #311
Labels
bug Something isn't working triage

Comments

@ward-resa
Copy link

Describe the bug

When compiling the log function is called when it should be skipped. This causes an extra log entry to be created when compiling any model that might call the stage_external_tables macro. There aren't any sources available during compile time. The macro shouldn't log that. It is expected.

Steps to reproduce

Add the stage_external_tables macro to a pre-hook, analysis, or other file that will cause an execution during compile time.

Expected results

No log entries should be written during compile.

Actual results

A log entry is created for each time the macro is referenced in a file.

Which database are you using dbt with?

  • redshift
  • snowflake
  • other (specify: BigQuery)

The output of dbt --version:

Core:
  - installed: 1.8.4
  - latest:    1.8.4 - Up to date!

Plugins:
  - bigquery: 1.8.2 - Up to date!

The operating system you're using:

macOs 14.5

The output of python --version:

Python 3.11.9

Additional context

I believe that we can change line 36 in the stage_external_tables to fix the issue.

Existing code

    {% if sources_to_stage|length == 0 %}

Proposed change

    {% if sources_to_stage|length == 0 and execute %}
@ward-resa ward-resa added bug Something isn't working triage labels Aug 1, 2024
ward-resa added a commit to ward-resa/dbt-external-tables that referenced this issue Aug 8, 2024
@ward-resa ward-resa linked a pull request Aug 8, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant