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

task callsites: part 2 #4188

Merged
merged 11 commits into from
Nov 4, 2021
Merged

task callsites: part 2 #4188

merged 11 commits into from
Nov 4, 2021

Conversation

emmyoop
Copy link
Member

@emmyoop emmyoop commented Nov 2, 2021

Description

Modifying call sites for structured logging in core/dbt/task

#4183 is Part 1 of the same dir

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

@cla-bot cla-bot bot added the cla:yes label Nov 2, 2021
core/dbt/events/types.py Outdated Show resolved Hide resolved
@emmyoop emmyoop marked this pull request as ready for review November 3, 2021 18:42
Copy link
Contributor

@nathaniel-may nathaniel-may 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! Only a few minor things.

core/dbt/task/base.py Outdated Show resolved Hide resolved
Comment on lines 44 to 73
if hasattr(result, 'node'):
source_name = result.node.source_name
table_name = result.node.name
else:
source_name = result.source_name
table_name = result.table_name
if result.status == FreshnessStatus.RuntimeErr:
fire_event(PrintHookEndErrorLine(source_name=source_name,
table_name=table_name,
index=self.node_index,
total=self.num_nodes,
execution_time=result.execution_time))
elif result.status == FreshnessStatus.Error:
fire_event(PrintHookEndErrorStaleLine(source_name=source_name,
table_name=table_name,
index=self.node_index,
total=self.num_nodes,
execution_time=result.execution_time))
elif result.status == FreshnessStatus.Warn:
fire_event(PrintHookEndWarnLine(source_name=source_name,
table_name=table_name,
index=self.node_index,
total=self.num_nodes,
execution_time=result.execution_time))
else:
fire_event(PrintHookEndPassLine(source_name=source_name,
table_name=table_name,
index=self.node_index,
total=self.num_nodes,
execution_time=result.execution_time))
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks like it was pretty non-trivial to change. I really like what you did with it here: It brings the important stuff to the top, and buries the stuff we don't care about as much. Nice job.

core/dbt/events/types.py Outdated Show resolved Hide resolved
core/dbt/events/types.py Outdated Show resolved Hide resolved
@emmyoop emmyoop requested a review from nathaniel-may November 3, 2021 21:11
Copy link
Contributor

@nathaniel-may nathaniel-may left a comment

Choose a reason for hiding this comment

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

Perfect. Thanks!

@emmyoop emmyoop merged commit 4d80b14 into feature/structured-logging Nov 4, 2021
@emmyoop emmyoop deleted the er/sl-task-2 branch November 4, 2021 15:30
emmyoop added a commit that referenced this pull request Nov 8, 2021
* add struct logging to docs serve

* remove merge fluff

* struct logging to seed command

* converting print to use structured logging

* more structured logging print conversion

* pulling apart formatting more

* added struct logging by disecting printer.py

* add struct logging to runnable

* add struct logging to task init

* fixed formatting

* more formatting and moving things around
emmyoop added a commit that referenced this pull request Nov 8, 2021
* add struct logging to docs serve

* remove merge fluff

* struct logging to seed command

* converting print to use structured logging

* more structured logging print conversion

* pulling apart formatting more

* added struct logging by disecting printer.py

* add struct logging to runnable

* add struct logging to task init

* fixed formatting

* more formatting and moving things around
kwigley pushed a commit that referenced this pull request Nov 9, 2021
* add struct logging to docs serve

* remove merge fluff

* struct logging to seed command

* converting print to use structured logging

* more structured logging print conversion

* pulling apart formatting more

* added struct logging by disecting printer.py

* add struct logging to runnable

* add struct logging to task init

* fixed formatting

* more formatting and moving things around
nathaniel-may pushed a commit that referenced this pull request Nov 9, 2021
* add struct logging to docs serve

* remove merge fluff

* struct logging to seed command

* converting print to use structured logging

* more structured logging print conversion

* pulling apart formatting more

* added struct logging by disecting printer.py

* add struct logging to runnable

* add struct logging to task init

* fixed formatting

* more formatting and moving things around
iknox-fa pushed a commit that referenced this pull request Feb 8, 2022
* add struct logging to docs serve

* remove merge fluff

* struct logging to seed command

* converting print to use structured logging

* more structured logging print conversion

* pulling apart formatting more

* added struct logging by disecting printer.py

* add struct logging to runnable

* add struct logging to task init

* fixed formatting

* more formatting and moving things around

automatic commit by git-black, original commits:
  3cafc9e
iknox-fa pushed a commit that referenced this pull request Feb 8, 2022
* add struct logging to docs serve

* remove merge fluff

* struct logging to seed command

* converting print to use structured logging

* more structured logging print conversion

* pulling apart formatting more

* added struct logging by disecting printer.py

* add struct logging to runnable

* add struct logging to task init

* fixed formatting

* more formatting and moving things around

automatic commit by git-black, original commits:
  3cafc9e
  73f7fba
iknox-fa pushed a commit that referenced this pull request Feb 8, 2022
* add struct logging to docs serve

* remove merge fluff

* struct logging to seed command

* converting print to use structured logging

* more structured logging print conversion

* pulling apart formatting more

* added struct logging by disecting printer.py

* add struct logging to runnable

* add struct logging to task init

* fixed formatting

* more formatting and moving things around

automatic commit by git-black, original commits:
  3cafc9e
  9cc7a7a
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.

2 participants