File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 22import sys
33from 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-
105from .airbyte_protocol import ( # type: ignore[attr-defined] # all classes are imported to airbyte_protocol via *
116 AirbyteCatalog ,
127 AirbyteMessage ,
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
2326class AirbyteStateBlobType (CustomType [AirbyteStateBlob , Dict [str , Any ]]):
2427 def serialize (self , value : AirbyteStateBlob ) -> Dict [str , Any ]:
You can’t perform that action at this time.
0 commit comments