implemented items, to_object and zip functions#105
implemented items, to_object and zip functions#105jstewmon wants to merge 3 commits intojmespath:developfrom
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_objectmay 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?