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

Allow for lazy-evaluation of arguments in LazyFormat #1669

Merged
merged 2 commits into from
Feb 10, 2025
Merged

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Feb 7, 2025

When creating a LazyFormat object, the keyword argument values may be constructed from expensive methods. Similar to allowing a function to be passed in for the message argument, this PR enables methods to be passed in for the keyword argument values so that they can be lazily evaluated.

There were some logging calls that were found in performance profiling to be expensive because lazy-evaluation was not done, so this PR updates a few of those call sites as well. An alternative approach would have been to implement MetricFlowPrettyFormattable for those objects.

@cla-bot cla-bot bot added the cla:yes label Feb 7, 2025
@plypaul plypaul marked this pull request as ready for review February 7, 2025 02:55
@plypaul plypaul requested a review from a team as a code owner February 7, 2025 02:55
@plypaul plypaul merged commit 07c7ee5 into main Feb 10, 2025
11 checks passed
@plypaul plypaul deleted the p--misc--04 branch February 10, 2025 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants