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

[Feature] Improve logging and display of information #34

Merged
merged 8 commits into from
Dec 9, 2022

Conversation

b-per
Copy link
Collaborator

@b-per b-per commented Dec 5, 2022

  • Uses rich to display a table summarizing the changes between the local file and dbt Cloud
  • Also moved some warning logging to info

Example of screenshot with plan:
image

This class stores the changes identified in 2 ways:
- a descriptive way, with an action/type/id
- a programmatic way, on how it should be handled (func and params)
The logic becomes a bit more complex to handle the case
where we setup env var overwrites in a new job that doesn't
exist in Cloud yet
@b-per b-per requested a review from nicholasyager December 5, 2022 11:14
Copy link
Contributor

@nicholasyager nicholasyager left a comment

Choose a reason for hiding this comment

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

@b-per This is a much-needed addition for improved readability. One small recommendation would be to include the original and updated values for what changed in a given object. It's a little extra overhead from a data tracking perspective, but I imagine it will prevent unexpected updates in the future if someone accidentally adds a typo into their config.

What are your thoughts?

Comment on lines +38 to +52
def to_table(self) -> Table:
"""Return a table representation of the changeset."""

table = Table(title="Changes detected")

table.add_column("Action", style="cyan", no_wrap=True)
table.add_column("Type", style="magenta")
table.add_column("ID", style="green")

for change in self.__root__:
table.add_row(
change.action.upper(), string.capwords(change.type), change.identifier
)

return table
Copy link
Contributor

Choose a reason for hiding this comment

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

This is beautiful! Excellent use of rich.

@b-per
Copy link
Collaborator Author

b-per commented Dec 9, 2022

Thanks for the feedback! If it's ok with you, I'd like to get this one across and tackle enhancing the before/after changes as part of another issue (I created #35 for it).

If you agree, could you approve this PR?

@nicholasyager
Copy link
Contributor

Thanks for the feedback! If it's ok with you, I'd like to get this one across and tackle enhancing the before/after changes as part of another issue (I created #35 for it).

If you agree, could you approve this PR?

Totally fair! Let's :shipit:

@b-per b-per merged commit fc8ae1b into main Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants