-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat(parse): add text::simple_extensions::ArgumentsItem
parser
#185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution! This looks great.
It would be really great if we can run tests against the extensions in the substrait
submodule.
How about adding tests against the extensions in the substrait submodule in the future prs, i.e. after including extensions in this repo like the work you have done in the closed pr: https://github.com/mbrobbel/substrait-rs/blob/aebd6cc53152cda3602decfbd096329e6f4e5850/build.rs#L188-L197 |
Sounds good: #186 |
This came up in a [discussion on a substrait-rs PR](substrait-io/substrait-rs#185 (comment)): it doesn't make sense for the options field of enum args to be empty. This PR modifies the schema to state that the `options` array of enum args should be non-empty.
1634a5b
to
a41f650
Compare
I have implemented But when I try to add checks to ensure the parsing work for core extensions, I encountered a problem:
fn parse(self, ctx: &mut C) -> Result<Self::Parsed, Self::Error>;
error[E0507]: cannot move out of `*item` which is behind a shared reference
--> src/parse/text/simple_extensions/argument.rs:632:21
|
632 | item.parse(&mut Context::default())?;
| ^^^^ move occurs because `*item` has type `text::simple_extensions::ArgumentsItem`, which does not implement the `Copy` trait I'm wondering that if we can modify |
You can clone the
We could do this, but it moves cloning (where needed) into the parser impls - unless we also change all parsed items to reference data in the original items. I think the common case would be for users to have owned instances they want to parse, and when they don't, like in your example when you only have a reference, users can explicitly clone. What do you think? |
4871d9d
to
6b517ff
Compare
Thank you for your detailed explanation. It makes sense to me. This pr is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I have some final questions/suggestions - but we can also move some of these to follow-up PRs if you want.
46cff4e
to
9ed0578
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed one typo, but other than that this looks good, thanks again!
Co-authored-by: Matthijs Brobbel <[email protected]>
Really appreciate your review! |
Adds a parser for
text::simple_extensions::ArgumentsItem
that parses the argument.