Skip to content
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

[schellar] workflow_context as a json #56

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions schellar/python/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
# 1.1.0
- Update dependencies
- Add response handler with task Failed status

# 1.2.0
workflow_context as a JSON input in workflow
changes stringify on workflow_context worker input
4 changes: 2 additions & 2 deletions schellar/python/frinx_worker/schellar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]:
)

if worker_input.workflow_context:
create_schedule.input.workflow_context = json_dumps(worker_input.workflow_context).replace('"', '\\"')
create_schedule.input.workflow_context = json_dumps(worker_input.workflow_context)

mutation = create_schedule.render(form="extracted")
response = execute_schellar_query(query=mutation.query, variables=mutation.variable)
Expand Down Expand Up @@ -279,7 +279,7 @@ def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]:
)

if worker_input.workflow_context:
update_schedule.input.workflow_context = json_dumps(worker_input.workflow_context).replace('"', '\\"')
update_schedule.input.workflow_context = json_dumps(worker_input.workflow_context)

mutation = update_schedule.render()
response = execute_schellar_query(query=mutation.query, variables=mutation.variable)
Expand Down
4 changes: 2 additions & 2 deletions schellar/python/frinx_worker/schellar/workflows/schellar.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class WorkflowInput(WorkflowImpl.WorkflowInput):
name="workflow_context",
frontend_default_value="",
description="Workflow input parameters in json format",
type=FrontendWFInputFieldType.STRING,
type=FrontendWFInputFieldType.JSON,
)

from_date: WorkflowInputField = WorkflowInputField(
Expand Down Expand Up @@ -159,7 +159,7 @@ class WorkflowInput(WorkflowImpl.WorkflowInput):
name="workflow_context",
frontend_default_value="",
description="Workflow input parameters in json format",
type=FrontendWFInputFieldType.STRING,
type=FrontendWFInputFieldType.JSON,
)

from_date: WorkflowInputField = WorkflowInputField(
Expand Down
2 changes: 1 addition & 1 deletion schellar/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ packages = [{ include = "frinx_worker" }]
name = "frinx-schellar-worker"
description = "Conductor worker for Schellar service"
authors = ["Jozef Volak <[email protected]>"]
version = "1.1.1"
version = "1.2.0"
readme = ["README.md", "CHANGELOG.md", "RELEASE.md"]
keywords = ["frinx-machine", "schellar", "worker"]
license = "Apache 2.0"
Expand Down
Loading