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

Fix the sample SQL when the source has no database #272

Merged
merged 5 commits into from
May 17, 2022

Conversation

b-per
Copy link
Contributor

@b-per b-per commented May 10, 2022

resolves #264

Description

Fix for the issue raised where the sample SQL Code is incorrect when the data source isn't linked to any database (like in databricks).

To test it, I updated the database field in my manifest.json, replacing "jaffle_shop" by "".

Behaviour before the change, when no DB is defined:
image

Behaviour after the change, when no DB is defined:
image

Behaviour after the change, when a DB is defined:
image

Checklist

  • I have signed the CLA
  • I have generated docs locally, and this change appears to resolve the stated issue
  • I have updated the CHANGELOG.md and added information about my change to the "dbt next" section.

@cla-bot cla-bot bot added the cla:yes label May 10, 2022
Co-authored-by: Stu Kilgore <stuart.kilgore@gmail.com>
@emmyoop emmyoop requested a review from stu-k May 11, 2022 19:41
Copy link
Contributor

@stu-k stu-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

Copy link
Member

@emmyoop emmyoop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I tested locally and it works as expected!

This is going to go in to 1.2.0. If you pull in recent changes, there's a spot in the CHANGELOG for that now. Please update your CHANGELOG entry to be under the accurate release and I'll get this merged in. Also, don't forget to add yourself under Contributors 😃

Thank you so much for the contribution @b-per!

@b-per b-per requested a review from emmyoop May 17, 2022 10:58
Copy link
Member

@emmyoop emmyoop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks again!

@emmyoop emmyoop merged commit fd58b2b into main May 17, 2022
@martinburch
Copy link

Sorry, bit late to this, and many thanks to the reviewers, but is it ok that this code will now require model.identifier whereas the old code tried to use model.identifier, model.alias, or model.name?

@b-per
Copy link
Contributor Author

b-per commented May 19, 2022

I think that it is OK, yes.
The previous code was more generic and had some logic that could apply to models as well as sources. The bit of code changed is actually only executed for sources so we don't have to worry about alias (which don't apply to sources) and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

databricks sample SQL has a dot before the schema name
4 participants