-
-
Notifications
You must be signed in to change notification settings - Fork 1
✨ add EncodeOptions.comma_compact_nulls
#31
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
Conversation
…list serialization
WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant encode as encode()
participant _encode as _encode()
participant Filter as NullFilter
participant Join as JoinItems
Client->>encode: call with EncodeOptions(comma_compact_nulls=True)
encode->>_encode: enter list branch (comma mode), pass flag
_encode->>_encode: build comma_items [T,F,None,T]
alt comma_compact_nulls == true
_encode->>Filter: remove None -> [T,F,T]
else comma_compact_nulls == false
_encode->>_encode: keep placeholders -> [T,F, ,T]
end
_encode->>Join: normalize / encode items
Join->>encode: obj_keys_value ("true,false,true" or with empty slots)
encode->>Client: serialized output
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #31 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 1150 1162 +12
=========================================
+ Hits 1150 1162 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This pull request introduces a new option,
comma_compact_nulls, to the encoding logic for lists using the COMMA format. This option allows users to omitNonevalues from lists when encoding, resulting in more compact query strings. The change is documented, implemented in the encoding logic, and covered with new unit tests.Feature: Comma List Encoding Improvements
comma_compact_nullsoption toEncodeOptions, allowing omission ofNoneentries in lists when using the COMMA format. This results in cleaner output (e.g.,[True, False, None, True]becomestrue,false,true). [1] [2]_encodeto filter outNonevalues whencomma_compact_nullsis enabled, and to ensure round-trip behavior is preserved when bothcomma_round_tripandcomma_compact_nullsare set. [1] [2] [3]comma_compact_nullsparameter throughout the encoding process. [1] [2] [3] [4] [5]Documentation Updates
comma_compact_nullsoption in bothREADME.rstanddocs/README.rst, including usage examples and expected output. [1] [2]Testing
Noneentries, omitting keys when all entries areNone, and preserving round-trip markers.Summary by CodeRabbit
New Features
Documentation
Tests