Conversation
Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
To keep things consistent everywhere. An alternative would be to pass a delimiter character around, but I like this. Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
Now that we use it somewhere else. Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
It is only re-importing things for exposure. This should have gotten done in the API PR, but there was a server side hiccup where the tests never got ran and I didn't bother closing/reopening such a simple PR to run them once it was recovered. Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
Pinning all the way to patch versions is inconvenient. Now I've got to downgrade my pydantic version just because |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #175 +/- ##
==========================================
+ Coverage 97.91% 97.99% +0.08%
==========================================
Files 32 34 +2
Lines 2062 2248 +186
==========================================
+ Hits 2019 2203 +184
- Misses 43 45 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
As I currently do not have the dependabot pipeline in place for the python workflow definition, I extended the range to |
🚀
Super. pydantic needs to be un-downgraded. I'm going to clean up the git history for the versions while I do that. |
Signed-off-by: liamhuber <liamhuber@greyhavensolutions.com>
PR introduces bidirectional conversion between
flowrepandpython-workflow-definition(PWD) recipe formats.In the flowrep->PWD direction there are obviously constraints, namely that you can only convert flat, all-atomic workflows. In the PWD->flowrep direction there are constraints, but I think they're mostly the result of PWD not validating very strictly -- e.g. if you write a cyclic recipe you can get it validated in PWD but flowrep will throw an exception if you try to convert it. IMO that's an implementation restriction, not a conceptual one.
Conceptually, the conversions are not totally lossless. In particular, round tripping does not guarantee that you'll get back the same node names/ids (which are semi-arbitrary). Also, PWD doesn't differentiate the module vs qualname aspect of function references, so we're left guessing at how to split it1, and no version information is held whatsoever so we need to leave that blank.
But barring these losses, all three of the PWD test cases and a representative sample of flowrep recipes roundtrip quite nicely.
The new converters are exposed in the API, but not promoted all the way to be directly available on the module. A simple example:
Gives
(The 0.0.1 version is an artefact of the fact I'm running git clone repo source code here...)
Then we can get back to our original flowrep representation:
Gives
Note that in the original recipe, we'd have been able to see
inputs_with_defaults: ["x", "y"]for thefooatomic node recipe, but these get lost in round-tripping because there's nowhere to stick that information in the PWD representation. This doesn't make the roundtripped recipe wrong, just less complete in an acceptable way. Ultimately there are just some limitations in roundtripping like this, where we're limited for each piece of information by the minimal quality of information across transformed representations 🤷♂️Footnotes
This could be avoided by really trying to import the thing and then re-calculating its actual module+qualname, but I am not willing to go that far at the moment. ↩