-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Ct 738/dbt debug log fix #6541
Ct 738/dbt debug log fix #6541
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
1 similar comment
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VersusFacit The branch for the PR has conflicts to be resolved. Could you resolve those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR needs to have main merged because there have been a lot of changes in the events code and the messages as implemented in types.proto here will no longer work.
Rather than a bunch of new logging events I would prefer to have them combined as much as makes sense. We are going through an exercise of reducing the number of events and this is going in the opposite direction.
9a8c470
to
f0c5f5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
class TestProfiles: | ||
def dbt_debug(self, project_dir_cli_arg=None, profiles_dir_cli_arg=None): | ||
def dbt_debug(self, project, project_dir_cli_arg=None, profiles_dir_cli_arg=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excited about all the simplification you were able to do for the tests/functional/profiles/test_profile_dir.py
test!
Is adding project
essential? If not, what do you think about leaving it as the following?
def dbt_debug(self, project, project_dir_cli_arg=None, profiles_dir_cli_arg=None): | |
def dbt_debug(self, project_dir_cli_arg=None, profiles_dir_cli_arg=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbeatty10 It is because under the hood, the dbt invocation needs the profile for the run command; otherwise run_dbt or run_dbt_and_capture won't work -- without this I run into "profile not found errors". Kept barking at me during development.
You have a better solution by chance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, I was wrong. This was needed at some point, but now I can go in and remove it. Thanks for the callout 🙇♀️ 😅 I need to dive in the next time I find the error I describe, so I can identify if it's a context-specific bug or something more general. I've run into it too many times to be misremembering that, but also, my understanding of it has now been shifted as a result of this convo.
tl;dr merged your change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries!
Will be a very happy day once this is merged and my custom run_dbt_and_capture_stdout
is no longer a thing!
Will re-review shortly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only reviewed the changes to tests/functional/profiles/test_profile_dir.py
, and they look great!
Relying on other reviewers to cover everything else.
Behavior was confirmed and suggestion was applied
resolves #5353
And what a fun, instructive excursion this was. I got to edit some CLI jobs and walk around some execution parts of the repo -- how exciting 😊
What does this PR do?
dbt debug
structured loggingdbt --log-format json debug
andDBT_LOG_FORMAT=json dbt debug
both now render as structured logsprint
left in the file -- sweet!dbt {ls,list}
structured loggingdbt --log json {ls,list}
andDBT_LOG_FORMAT=json dbt {ls,list}
prints structured logs now, underinfo
leveldbt {ls,list}
continues to print just the names (🔪 -ed out some overrides and aTODO
or two)Before and After Screenshots
My debugging strategy:
Check evolving structured logs against plain ol'
dbt debug
.Before, several printed lines:
After, they're all structured logs now:
Minor caveat: These were taken in two different iterations so the connections listed are slightly different, but I just have lots of profiles :p
Outstanding Questions
protoc -I. --python_betterproto_out=. types.proto
. Hope that's right 🙇♀️Checklist
changie new
to create a changelog entry