Skip to content

Can't serialize graphs using Retry #115

Closed
@fitzoh

Description

@fitzoh

Just installed v1.1.2

from stepfunctions.steps import Graph, Task, states, Retry
retry = Retry(error_equals=["States.TaskFailed"])
Task(state_id="whatever", retry=retry).to_json()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/fitz/Workspace/github.com/mobikitinc/data-ingest/venv/lib/python3.8/site-packages/stepfunctions/steps/states.py", line 93, in to_json
    return json.dumps(self.to_dict())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Retry is not JSON serializable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions