-
Notifications
You must be signed in to change notification settings - Fork 182
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
implemented items, to_object and zip functions #105
base: develop
Are you sure you want to change the base?
Conversation
Awesome, thanks for the pull request. I would expect both of those cases to be errors, potentially type errors. I'm not sure if it's worth updating the type checker to support some sort of record/tuple type (that would just be a list with a fixed structure) or just adding this check in As an aside, I noticed the various |
Regarding the naming convention of That said, as a user I would find a type error is more informative than |
Codecov Report
@@ Coverage Diff @@
## develop jmespath/jmespath.site#105 +/- ##
==========================================
- Coverage 97.27% 96.77% -0.5%
==========================================
Files 13 13
Lines 1431 1459 +28
==========================================
+ Hits 1392 1412 +20
- Misses 39 47 +8
Continue to review full report at Codecov.
|
The main reason
Those conditions don't really apply with |
Ok, I see your point. I think either Do you like |
366bd4c
to
3016b06
Compare
Bump. This might have been nice for a use-case yesterday. |
implements jmespath/jmespath.jep#20
I think
to_object
may need additional input checking, but I'm not sure what the behavior should be for some error cases. For example,to_object(
[[1, 2, 3]])
will raiseValueError: dictionary update sequence element #0 has length 3; 2 is required
. Andto_object(
[[[1], 1]])
will raiseTypeError: unhashable type: 'list'
.Does the spec prescribe a behavior (like a specific error type) for these cases?