-
Notifications
You must be signed in to change notification settings - Fork 295
refactor(exprs): proc macro for parsing arguments into structs #4348
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
Merged
Conversation
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4348 +/- ##
==========================================
+ Coverage 77.85% 77.89% +0.04%
==========================================
Files 836 839 +3
Lines 111927 112105 +178
==========================================
+ Hits 87139 87323 +184
+ Misses 24788 24782 -6
🚀 New features to boost your workflow:
|
universalmind303
approved these changes
May 17, 2025
4 tasks
4 tasks
kevinzwang
added a commit
that referenced
this pull request
May 23, 2025
## Changes Made Add literal support for the FunctionArgs proc macro. Now, instead of using serde to serialize a Rust struct into a LiteralValue for Python functions, we can just store the Python objects directly as a `LiteralValue::Python`, and then implement the extraction to Rust struct in `FromLiteral`. This allows us to remove the LiteralValue serialization functionality, and also eliminates the need to special case every type in the Python-exposed `lit` function. ## Related Issues follow-up on #4348 ## Checklist - [x] Documented in API Docs (if applicable) - [x] Documented in User Guide (if applicable) - [x] If adding a new documentation page, doc is added to `docs/mkdocs.yml` navigation - [x] Documentation builds and is formatted properly (tag @/ccmao1130 for docs review)
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.
Changes Made
Added a proc macro that can be used by function expressions to easily convert from function expressions to argument structs.
It can be used as follows:
I've implemented it for all numeric functions (except round, which expects a literal) in this PR
Todo for future PRs:
Related Issues
none
Checklist
docs/mkdocs.yml
navigation