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

Add print() option #492

Merged
merged 1 commit into from
Oct 13, 2024
Merged

Add print() option #492

merged 1 commit into from
Oct 13, 2024

Conversation

AaronDMarasco
Copy link
Contributor

Allows a user-defined string (or callback function) to prefix every output when using the pretty() call.

Copy link
Owner

@seperman seperman left a comment

Choose a reason for hiding this comment

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

@AaronDMarasco
Interesting. Thanks for making the PR. I rarely use the print function but it seems you are using it extensively that you want to add a prefix.
Do you think the fstring overhead is that much? If yes, please go ahead with your suggestion. Compared to a lot of other parts of the code that we should optimize, I don't think the f-string's overhead is that much.

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.55%. Comparing base (111a2eb) to head (5f22bd2).
Report is 2 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #492   +/-   ##
=======================================
  Coverage   96.55%   96.55%           
=======================================
  Files          14       14           
  Lines        3946     3950    +4     
=======================================
+ Hits         3810     3814    +4     
  Misses        136      136           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AaronDMarasco
Copy link
Contributor Author

I'd say just take as-is then.

Our use case is that we ship a config file and then let the user write one that overrides. Then we dump the diff of the config data structure to the logs, so when they have issues we can see in the logs what may have been a dangerous change.

Copy link
Owner

@seperman seperman left a comment

Choose a reason for hiding this comment

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

LGTM!

@seperman
Copy link
Owner

@AaronDMarasco For that purpose, we have Delta Serialize To Flat Rows.

@seperman seperman merged commit cdc4b30 into seperman:dev Oct 13, 2024
7 checks passed
@AaronDMarasco
Copy link
Contributor Author

@AaronDMarasco For that purpose, we have Delta Serialize To Flat Rows.

Thanks; I'll read into that more later this week.

@AaronDMarasco AaronDMarasco deleted the dev branch October 13, 2024 22:10
@seperman
Copy link
Owner

Hi @AaronDMarasco
Thanks for contributing to DeepDiff. DeepDiff 8.1.0 is released and includes your code!

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