Skip to content

Commit a07d4d8

Browse files
Merge remote changes with formatting fixes
- Resolved merge conflict in airbyte_protocol_serializers.py - Accepted remote USE_RUST_BACKEND approach which is cleaner - Combined with local formatting fixes for double quotes Co-Authored-By: AJ Steers <[email protected]>
2 parents 45c3063 + 07f0b2a commit a07d4d8

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

airbyte_cdk/models/airbyte_protocol_serializers.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
import sys
33
from typing import Any, Dict
44

5-
if sys.platform == "emscripten":
6-
from serpyco import CustomType, Serializer
7-
else:
8-
from serpyco_rs import CustomType, Serializer
9-
105
from .airbyte_protocol import ( # type: ignore[attr-defined] # all classes are imported to airbyte_protocol via *
116
AirbyteCatalog,
127
AirbyteMessage,
@@ -19,6 +14,14 @@
1914
ConnectorSpecification,
2015
)
2116

17+
USE_RUST_BACKEND = sys.platform != "emscripten"
18+
"""When run in WASM, use the pure Python backend for serpyco."""
19+
20+
if USE_RUST_BACKEND:
21+
from serpyco_rs import CustomType, Serializer
22+
else:
23+
from serpyco import CustomType, Serializer
24+
2225

2326
class AirbyteStateBlobType(CustomType[AirbyteStateBlob, Dict[str, Any]]):
2427
def serialize(self, value: AirbyteStateBlob) -> Dict[str, Any]:

0 commit comments

Comments
 (0)