How to define default values for config of graph_asset? #18763
Unanswered
ivan-tsarev-bioage
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I happened to make yet another approach to making asset a proper reusable piece of logic and solved the above described issue with on of the most weird and cryptic snippet I've ever written:
It essentially allows my less-experienced colleagues to copy-paste asset definition function and tune it in-place to create another asset with very same logic but different params. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everybody!
We are now exploring how to switch from job-and-graph orchestration to assets.
And right now I'm struggling a lot figuring out a painless way to make logic inside assets re-usable with configuration.
So our old-style code usually looks like this:
And that what I see in UI:
In such a manner we got:
Overall, that looks like exactly what we want from configuring reusable logic.
So now I'm trying to reproduce this behaviour with asset somehow.
The less resistance path is using
graph_asset
, since we already have tons of graphs everywhere and we want to reuse it for sure.My graph_asset looks like:
Unfortunately, in UI it looks quite disappointing:
We lost all virtually all information on what the config is in the code and option to edit it on the go from UI.
Trying to use
config_mapping
like this:In the UI I got following picture:
Apparently, plain software-based asset share the same unpleasant feature, from what I understand - we can define default value for parameter on Config object-level, but not when actually using and re-using it in assets, making Assets either share default value or setting them in UI only.
We probably can subclass Config object for every asset redefining default values, but it sounds a bit too complicated to do to be honest.
Beta Was this translation helpful? Give feedback.
All reactions