Task Description #2293
Replies: 6 comments 6 replies
-
I agree, I do not see other viable approaches. I am assuming we are going to keep backward compatibility with I think one of the guiding principles should be to minimize the impact on current users/applications. Ideally, whatever we decide to do, users should change their code only if they need to executed function tasks instead of executable tasks. This would make me think that option 2 would have |
Beta Was this translation helpful? Give feedback.
-
I think option 1 is more convenient and more organized, it shows the separation between 2 different types of task perfectly ( |
Beta Was this translation helpful? Give feedback.
-
Have a remark for option 1: for now And just to clarify option 2: schema contains attribute |
Beta Was this translation helpful? Give feedback.
-
I am in favor of the third option. The following scenario plays into my head strongly with option 2, and I cannot shake it: "Yes, I only have a class to remember, but which is the correct attribute for an executable or function so that it works? Why are there different attributes? Can it not work regardless?". And then, we try to allow different combinations of On the other hand, option 3 does not create any ambiguity regarding what the task is for. I understand it may be a bit harder to implement, but I think it will make our lives easier in the long run. I also second @mtitov comments to keep |
Beta Was this translation helpful? Give feedback.
-
One more option (no.4) for consideration (at some points it overlaps with earlier proposed options):
class ExecObjDescription(ru.Munch):
_schema = {
'executable': str,
...
}
class FuncObjDescription(ru.Munch):
_schema = {
'function': ...,
...
}
class TaskDescription(ru.Munch):
_schema = {
'exec_obj': ru.Munch,
...
}
def __init__(self, from_dict):
if not isinstance(from_dict['exec_obj'], (dict, ru.Munch)):
raise ...
elif isinstance(from_dict['exec_obj'], dict):
if 'executable' in from_dict['exec_obj']:
from_dict['exec_obj'] = ExecObjDescription(from_dict['exec_obj'])
elif 'function' in from_dict['exec_obj']:
from_dict['exec_obj'] = FuncObjDescription(from_dict['exec_obj'])
...
super().__init__(from_dict=from_dict) Also these exec-object descriptions could have their own methods ( p.s. and later (according to one of the discussion we've started) |
Beta Was this translation helpful? Give feedback.
-
After discussion, we'll opt for version 3, but will add a factory to keep some of the benefits of version 4. Next, we'll have to revise the set of attributes we want to expose for each description type, and document them diligently. |
Beta Was this translation helpful? Give feedback.
-
Our current task description focuses on executables, but we move slowly toward including function calls and other call methods. That needs to be eventually reflected in the API, by making sure that task descriptions (TD) covers those.
I see several options:
Does anybody see other options?
I would currently favour the last approach, somewhat like this:
but I also like the simplicity and flexibility of option 2:
@iparask @mtitov @mturilli @AymenFJA: let's discuss :-)
Beta Was this translation helpful? Give feedback.
All reactions