Skip to content

AttributeError: 'CheckpointInput' object has no attribute 'action' #339

@5er9e1

Description

@5er9e1

I have a error:

Traceback (most recent call last):
  File "script.py", line 290, in <module>
    kcl_process.run()
    ~~~~~~~~~~~~~~~^^
  File "python3.14/site-packages/amazon_kclpy/kcl.py", line 296, in run
    self._handle_a_line(line)
    ~~~~~~~~~~~~~~~~~~~^^^^^^
  File "python3.14/site-packages/amazon_kclpy/kcl.py", line 275, in _handle_a_line
    self._report_done(action.action)
                      ^^^^^^^^^^^^^
AttributeError: 'CheckpointInput' object has no attribute 'action'

If we will see to kcl.py we will find a code like:

    def _handle_a_line(self, line):
        ...
        action = self.io_handler.load_action(line)
        self._perform_action(action)
        self._report_done(action.action)

Where action is amazon_kclpy.messages.CheckpointInput object.

If we go to amazon_kclpy/messages.py, we will find that

class CheckpointInput(object):
    ...
    def __init__(self, json_dict):
        ...
        self._sequence_number = json_dict["sequenceNumber"]
        self._sub_sequence_number = json_dict["subSequenceNumber"]
        self._error = json_dict.get("error", None)

    @property
    def sequence_number(self):
        ...

    @property
    def sub_sequence_number(self):
        ...

    @property
    def error(self):
        ...

here is really no action property.

Sounds like it should be fixed

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