feat(step-generation): more compact Python generation for dicts#18592
Merged
ddcc4 merged 4 commits intochore_release-pd-8.5.0from Jun 13, 2025
Merged
feat(step-generation): more compact Python generation for dicts#18592ddcc4 merged 4 commits intochore_release-pd-8.5.0from
ddcc4 merged 4 commits intochore_release-pd-8.5.0from
Conversation
Contributor
Author
|
@jerader If you want to merge your PR first, I'll wait for your PR and fix up all the merge/test conflicts myself. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## chore_release-pd-8.5.0 #18592 +/- ##
==========================================================
- Coverage 25.85% 23.65% -2.20%
==========================================================
Files 3278 3233 -45
Lines 284084 279692 -4392
Branches 28584 27929 -655
==========================================================
- Hits 73440 66159 -7281
- Misses 210617 213506 +2889
Partials 27 27
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
jerader
reviewed
Jun 11, 2025
| } | ||
|
|
||
| /** Render an array value as a Python tuple. */ | ||
| export function formatPyTuple(list: any[]): string { |
Collaborator
There was a problem hiding this comment.
makes more sense to have a separate fn for this, thanks!
jerader
approved these changes
Jun 11, 2025
Collaborator
jerader
left a comment
There was a problem hiding this comment.
this decreases the number of lines for the custom liquid class properties by a lot. thanks!
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
The custom liquid class dict for
define_liquid_class()is kind of big. This PR makes the dict formatting a bit more compact: if all the entries in the dict are scalar, and their total length is short-ish, we will emit the dict on a single line.Before:
After:
(See tests for other examples.)
This PR also cleans up the code for emitting lists of pairs as Python tuples that was introduced in PR #18558.
Test Plan and Hands on Testing
Added/updated unit tests.
Risk assessment
Low.