Skip to content

Commit b8703ea

Browse files
authored
update CDK airbyte protocol models to fix master build (#12829)
1 parent 04eb3b4 commit b8703ea

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py

+27-4
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,16 @@ class Config:
3636
namespace: Optional[str] = Field(None, description="the namespace of this record's stream")
3737

3838

39-
class AirbyteStateMessage(BaseModel):
40-
class Config:
41-
extra = Extra.allow
39+
class AirbyteStateType(Enum):
40+
GLOBAL = "GLOBAL"
41+
PER_STREAM = "PER_STREAM"
42+
4243

43-
data: Dict[str, Any] = Field(..., description="the state data")
44+
class AirbyteStateBlob(BaseModel):
45+
pass
46+
47+
class Config:
48+
extra = Extra.forbid
4449

4550

4651
class Level(Enum):
@@ -157,6 +162,14 @@ class OAuthConfigSpecification(BaseModel):
157162
)
158163

159164

165+
class AirbyteStreamState(BaseModel):
166+
class Config:
167+
extra = Extra.forbid
168+
169+
name: Optional[str] = Field(None, description="Stream name")
170+
state: Optional[AirbyteStateBlob] = None
171+
172+
160173
class AirbyteTraceMessage(BaseModel):
161174
class Config:
162175
extra = Extra.allow
@@ -244,6 +257,16 @@ class Config:
244257
)
245258

246259

260+
class AirbyteStateMessage(BaseModel):
261+
class Config:
262+
extra = Extra.allow
263+
264+
state_type: Optional[AirbyteStateType] = None
265+
data: Optional[Dict[str, Any]] = Field(None, description="(Deprecated) the state data")
266+
global_: Optional[AirbyteStateBlob] = Field(None, alias="global")
267+
streams: Optional[List[AirbyteStreamState]] = None
268+
269+
247270
class AirbyteCatalog(BaseModel):
248271
class Config:
249272
extra = Extra.allow

0 commit comments

Comments
 (0)