Skip to content

SET Type is not JSON serializable #5265

@guzzijones

Description

@guzzijones

SUMMARY

.toSet() yaql is no longer serialized to json by the workflow engine.
Provide a quick summary of your bug report.
While running a workflow with large input json I stumbled upon this serialization error for the workflow engine.

st2workflowengine.log:2021-05-12 17:49:46,697 140687301693512 ERROR workflows [-] [609c121c04f287f5ebf421a5] {'type': 'error', 'message': 'TypeError: Type is not JSON serializable 

STACKSTORM VERSION

st2 3.5dev (7af7122), on Python 3.6.8

OS, environment, install method

Centos 7

Steps to reproduce the problem

Create a workflow with a yaql statement that outputs a set
.toSet()

ie

version: 1.0
tasks:
  valid:
    action: core.noop
    next:
      - when: <%succeeded()%>
        publish:
          - valid: <% list(alist).toSet() %>
vars:
  - alist: [1,2,3,4]

Expected Results

Workflow does not fail

Actual Results

st2workflowengine.log:2021-05-12 17:49:46,697 140687301693512 ERROR workflows [-] [609c121c04f287f5ebf421a5] {'type': 'error', 'message': 'TypeError: Type is not JSON serializable  set', 'task_id': 'valid_emails', 'route': 1}

workflow fails

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions