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

stage_external_sources Comparing source_name of the node instead of the name of the node #309

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

stage_external_sources Comparing source_name of the node instead of the name of the node #309

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

Comments

@ward-resa
Copy link

Describe the bug

When calling the stage_external_sources macro and passing the source name as a list of values, when the name does not contain a '.' it is comparing the node.source_name instead of the node.name for the selected source.

Steps to reproduce

In my pre-hook I am can call the macro with the select parameter with the schema.source_name and it works. If I just call it with the source_name it does not.

Expected results

Calling the macro with the schema or without the schema should still find the source by name.

Actual results

Ignores the source if only the name is used in the select parameter.

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 Line 20 in the macro stage_external_sources is the culprit. I think that the following would fix the issue. Unless I am misinterpreting the intention of that line of code.

existing code

                        {% if src == node.source_name %}

proposed change

                        {% if src == node.name %}
@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
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
1 participant