-
Notifications
You must be signed in to change notification settings - Fork 0
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
Default WorkflowTask
arguments
#127
Comments
Very good point. It appears to me that the json schemas are the more general version of defaults. Can we make the json schema the new default args? i.e. the server doesn't have a separate default args, but when adding a task to a workflow, the schema is used to set defaults (=> to set the initial values of workflowTask.args, not to populate a separate default_args entry or anything of the sort). Both on the web and on the CLI. Or is there a reason to have both default_args and json schema?
Unless we add the json-schema as the workflow args when adding a task?
Sounds good to me! |
Agreed
I don't see any reason for that.
Let's check if I understand correctly: What you would be is the current " {
"Y": 1231,
} To make it explicit, I don't think that overriding a default value should ever require the user to prepare a JSON file like {
"title": "TaskArguments",
"type": "object",
"properties": {
"Y": {
"title": "Y",
"default": 1,
"type": "integer"
}
}
}
Exactly: If we do follow up as described above&below, then this specific issue is fixed.
Ref: |
We realized this issue may become tricky, but the main feature is present. The rest is part of #209. Closing. |
Branching from #82, since it is a more specific discussion.
@rkpasia be aware that this discussion touches multiple Fractal components/repositories, even if it is fully driven by the needs of the web client.
Let me rephrase my question, to clarify what we had in mind.
When the user adds a WorkflowTask in the web client, the situation is that
WorkflowTask.args
field is empty (this could change with ImportTask
default attributesWorkflowTask
attributes fractal-server#592),WorkflowTask.task.default_args
may include some defaults (but not necessarily all of them),WorkflowTask.task.args_schema
) may include some defaults (the ones coming from the pydantic model, since we are moving away from defaults in the python task function). These defaults are not part of the databaseWorkflowTask.args
entry.I/we have a few considerations
(A) Too many sources? Should we drop
Task.default_args
?My first (high-level) point is that we have many sources for the same information (the JSON schema and the
default_args
field). I'm in favor of dropping theTask.default_args
attribute, and moving this information into theTask.args_schema
field.Having both clearly introduces some confusion: they are both named "default", but one of them has to take priority. Which one? And why?
Side effect: when using the CLI client (where the
args_schema
attribute is ignored), we would not be able to rely on the task default arguments. Or, if we thinks it's crucial, we will have to implement the handling of schemas also in the CLI client (which doesn't seem ideal, but can be done).(B) What is shown when a
WorkflowTask
is inserted?Original question: what does the user see when they create a WorkflowTask?
Concerning pre-filled default values, there are two extreme cases that are both unsatisfactory:
X
if it present inWorkflowTask.args
(or inWorkflowTask.task.default_args
, as per the current DB structure - but this could change with (A) or with ImportTask
default attributesWorkflowTask
attributes fractal-server#592). This means that JSON-schema defaults are not visible -> not a good option.X
is123
), but they are not yet part ofWorkflowTask.args
until we make an API call.I'll rephrase once more in more precise terms.
Task
as aWorkflowTask
.WorkflowTask.args
is empty.Task.default_args
is not present (in line with my proposal (A), if accepted)Task.args_schema
has the following specificationX
is an integer with no default.Y
is an integer with default1
.Z
is an optional integer (note that optional integer, as inZ: typing.Optional[int]
, has a well-defined meaning, and it corresponds toZ: Union[int, None] = None
).WorkflowTask.args
is empty.Proposed solution: the JSON schema defaults must be used to pre-fill
WorkflowTask.args
when we insert it into a workflow (à la fractal-analytics-platform/fractal-server#592). In this way, it's clear what the user would see the first time they insert a Task into a Workflow.To be checked: while merging
Task.default_args
intoWorkflowTask.args
is trivial, we should further explore how to do it withTask.args_schema
andWorkflowTask.args
.The text was updated successfully, but these errors were encountered: