-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fixed a problem not to be able to parse input value which is type of dict in array in some YAQL operators. #191
Fixed a problem not to be able to parse input value which is type of dict in array in some YAQL operators. #191
Conversation
…dict in array in some YAQL operators. In some YAQL operators (e.g. distinct) refer to hash value of input value by calling __hash__ method. But some basic data structures (list, dict and set) don't implement this method. This commit adds a feature that may convert input datastructure from unhashable one to hashable one by using YAQL library that orquesta uses.
Auto generate and upate the json schemas for the workflow spec
I realized some other problems (other than #193) have to be cared so I amended title as WIP. |
…for being able to be compatible with FrozenDict object which is passed by YAQLEvaluator
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.
Can you add unit test(s) of a workflow with variables of various data types, publish those variables in a task transition into the context, write them out to the workflow output, and then check data and type is the same?
The various data types should be those touched by https://github.com/openstack/yaql/blob/master/yaql/language/utils.py#L67.
Please put the unit test(s) under https://github.com/StackStorm/orquesta/blob/master/orquesta/tests/unit/conducting/test_workflow_conductor_data_flow.py.
Thank you very much for your review and I appreciate your clear instructions! |
…ype only for Sequence and Mapping types
Codecov Report
@@ Coverage Diff @@
## master #191 +/- ##
=======================================
Coverage 94.03% 94.04%
=======================================
Files 41 41
Lines 2731 2735 +4
Branches 544 545 +1
=======================================
+ Hits 2568 2572 +4
Misses 100 100
Partials 63 63
Continue to review full report at Codecov.
|
ea04b50
to
8532901
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.
Can you create a separate set of tests similar to WorkflowConductorDataFlowTest but then the workflow is using Jinja expressions instead of YAQL expressions? Since this change is converting dict to YAQL types, we have to make sure that it doesn't break Jinja users.
… with another workflow definision that uses Jinja expressions as with YAQL's one.
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.
@userlocalhost LGTM. I made some minor cleanup. Thanks for the contribution and being diligent.
Abstract
This fixes a problem not to be able to parse data which is typed dict(etc) in array in some YAQL operators by converting input data-structure from unhashable value to hashable one. (c.f. #176)
Problem
Orquesta couldn't handle dict in array typed value in some yqal operators (e.g.
distinct
) as below.Execution Result
Cause & Measure
In some YAQL operators (e.g.
distinct
) refer to hash value of input data to identify it. And the openstack/YAQL library that Orquesta uses wraps those input value using utils.convert_output_data to prevent TypeError exception when these operator's implementation try to refer to input hash value. Thus, we can handle these value in thedistinct
operator like following. And this PR applies it to the Orquesta.(c.f. openstack/yaql@67d58bc)
Execution Result