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

Return proper error message when empty profiles.yml is used for project #2297

Conversation

sumanau7
Copy link
Contributor

@sumanau7 sumanau7 commented Apr 5, 2020

resolves #2292

Description

Return proper error message when profiles.yaml is empty

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • 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 Apr 5, 2020
@sumanau7 sumanau7 force-pushed the fix/return_proper_msg_for_empty_profile branch from 1a6af7b to 4f88355 Compare April 5, 2020 18:56
@sumanau7 sumanau7 marked this pull request as ready for review April 5, 2020 18:56
@sumanau7
Copy link
Contributor Author

sumanau7 commented Apr 5, 2020

@drewbanin Request for review.

Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR @sumanau7! This is a good and positive change, but I think there's also another closely related change for us to make here too.

Right now, if you have the following files:

# dbt_project.yml

name: debug
version: 1.0.0

profile: my_profile
# profiles.yml

my_profile:

dbt will also fail hard with an unhelpful error:

argument of type 'NoneType' is not iterable

Can we also address that case here too? This is the proximate bug described in #2292, but I am thrilled that you fixed another issue in here too!

core/dbt/config/profile.py Outdated Show resolved Hide resolved
@sumanau7 sumanau7 force-pushed the fix/return_proper_msg_for_empty_profile branch from a4240aa to c2dc216 Compare April 6, 2020 17:46
@drewbanin
Copy link
Contributor

Thanks @sumanau7 - these changes look great! I just kicked off the tests here, and I'm tagging @beckjake to give this a quick review too :)

@drewbanin drewbanin requested a review from beckjake April 6, 2020 19:34
Copy link
Contributor

@beckjake beckjake left a comment

Choose a reason for hiding this comment

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

This looks great to me!

Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

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

Thanks for making this PR @sumanau7! We can merge this as soon as you've updated the CHANGELOG.md file with the nature of this change :)

Nice work!

@sumanau7 sumanau7 force-pushed the fix/return_proper_msg_for_empty_profile branch from 21da349 to b78f515 Compare April 7, 2020 04:57
@sumanau7
Copy link
Contributor Author

sumanau7 commented Apr 7, 2020

Updated Changelog.

CHANGELOG.md Outdated Show resolved Hide resolved
@sumanau7 sumanau7 force-pushed the fix/return_proper_msg_for_empty_profile branch from f55e2ed to 35b43e9 Compare April 8, 2020 15:29
@beckjake beckjake merged commit 935f985 into dbt-labs:dev/octavius-catto Apr 8, 2020
@beckjake
Copy link
Contributor

beckjake commented Apr 8, 2020

Another great PR, thanks for contributing to dbt!

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.

An empty profile returns an un-useful error
3 participants