Skip to content

Commit

Permalink
[ISSUE #19733] adding validation for state
Browse files Browse the repository at this point in the history
  • Loading branch information
maxi297 committed Dec 2, 2022
1 parent 6f732f6 commit ab1df04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airbyte-cdk/python/airbyte_cdk/sources/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def read_state(self, state_path: str) -> Union[List[AirbyteStateMessage], Mutabl
:return: The complete stream state based on the connector's previous sync
"""
if state_path:
state_obj = json.loads(open(state_path, "r").read())
state_obj = self.read_json_file(state_path)
if not state_obj:
return self._emit_legacy_state_format({})
is_per_stream_state = isinstance(state_obj, List)
Expand Down

0 comments on commit ab1df04

Please sign in to comment.