Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

spruce up CLI output in dbt context #381

Merged
merged 12 commits into from
Feb 9, 2023

Conversation

leoebfolsom
Copy link
Contributor

@leoebfolsom leoebfolsom commented Feb 6, 2023

My attempt at improving the CLI printout without using any additional python packages.

BEFORE:
Screenshot 2023-02-01 at 23 54 09

AFTER:
Screenshot 2023-02-01 at 23 52 48

TODO based on comments in dlawin#3:

@leoebfolsom
Copy link
Contributor Author

@erezsh first, please note that this is a new PR now that Dan's dbt integration is merged into master.

I've made all the changes suggested by you and Dan in the previous PR except for using zip() / unzip(). I found some explainers since zip() is new to me, but I'm not sure how they would apply here.

My goal is to add to keep track of conflicts for each of the extra_columns as I iterate through the rows of result_list, and store the counts in a dictionary: { first_name: 14, last_name: 0, street: 0, city: 2, state: 0, ... } representing the # of conflicts per column.

I can see how it's repetitive to iterate through for i in range(0,len(extra_columns)): for each row and then check the value based on the index (if extra_column_values[i] != extra_column_values_store[k][i]:) for every column.

However, I'm struggling to see where I could gain efficiency using zip(). Can you please be more specific about what you have in mind and/or provide an example?

@leoebfolsom leoebfolsom marked this pull request as ready for review February 6, 2023 23:08
@leoebfolsom leoebfolsom requested a review from erezsh February 6, 2023 23:09
@leoebfolsom leoebfolsom requested a review from dlawin February 7, 2023 20:33
Copy link
Contributor

@dlawin dlawin left a comment

Choose a reason for hiding this comment

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

Approving with the performance/readability caveats I've mentioned

@leoebfolsom leoebfolsom marked this pull request as draft February 8, 2023 22:32
@williebsweet williebsweet marked this pull request as ready for review February 9, 2023 14:52
@williebsweet williebsweet merged commit b4b3008 into datafold:master Feb 9, 2023
@leoebfolsom leoebfolsom deleted the cli-output-update branch February 9, 2023 21:50
dbeatty10 added a commit to dbeatty10/data-diff that referenced this pull request Feb 23, 2023
dbeatty10 added a commit to dbeatty10/data-diff that referenced this pull request Feb 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants