File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change 5656 ab_connector_spec_to_string ,
5757 ab_message_from_string ,
5858 ab_message_to_string ,
59+ ab_state_message_to_string ,
5960)
6061from .well_known_types import (
6162 BinaryData ,
Original file line number Diff line number Diff line change @@ -159,21 +159,16 @@ def ab_state_message_from_string(
159159 raise ValueError (f"Failed to decode JSON: { e } " ) from e
160160
161161
162- def ab_state_blob_from_string (
163- state_blob_json : str ,
164- ) -> AirbyteStateBlob :
162+ def ab_state_message_to_string (
163+ state : AirbyteStateMessage ,
164+ ) -> str :
165165 """
166- Convert a JSON string to an AirbyteStateBlob .
166+ Convert an AirbyteStateMessage to a JSON string .
167167
168168 Args:
169- state_blob_json (str ): The JSON string to convert.
169+ state (AirbyteStateMessage ): The AirbyteStateMessage to convert.
170170
171171 Returns:
172- AirbyteStateBlob: The deserialized AirbyteStateBlob .
172+ str: JSON string representation of the AirbyteStateMessage .
173173 """
174- try :
175- return AirbyteStateBlob .model_validate_json (state_blob_json )
176- except ValidationError as e :
177- raise ValueError (f"Invalid AirbyteStateBlob format: { e } " ) from e
178- except orjson .JSONDecodeError as e :
179- raise ValueError (f"Failed to decode JSON: { e } " ) from e
174+ return state .model_dump_json ()
You can’t perform that action at this time.
0 commit comments