Skip to content

Commit

Permalink
Use jsongenerator 1.0.1 (#12554)
Browse files Browse the repository at this point in the history
* Use jsongenerator 1.0.1

* Fix connectors base
  • Loading branch information
tuliren committed May 4, 2022
1 parent 6f927fc commit a294f40
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
33 changes: 33 additions & 0 deletions airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Type(Enum):
SPEC = "SPEC"
CONNECTION_STATUS = "CONNECTION_STATUS"
CATALOG = "CATALOG"
TRACE = "TRACE"


class AirbyteRecordMessage(BaseModel):
Expand Down Expand Up @@ -59,6 +60,25 @@ class Config:
message: str = Field(..., description="the log message")


class Type1(Enum):
ERROR = "ERROR"


class FailureType(Enum):
system_error = "system_error"
config_error = "config_error"


class AirbyteErrorTraceMessage(BaseModel):
class Config:
extra = Extra.allow

message: str = Field(..., description="A user-friendly message that indicates the cause of the error")
internal_message: Optional[str] = Field(None, description="The internal error that caused the failure")
stack_trace: Optional[str] = Field(None, description="The full stack trace of the error")
failure_type: Optional[FailureType] = Field(None, description="The type of error")


class Status(Enum):
SUCCEEDED = "SUCCEEDED"
FAILED = "FAILED"
Expand Down Expand Up @@ -137,6 +157,15 @@ class OAuthConfigSpecification(BaseModel):
)


class AirbyteTraceMessage(BaseModel):
class Config:
extra = Extra.allow

type: Type1 = Field(..., description="the type of trace message")
emitted_at: float = Field(..., description="the time in ms that the message was emitted")
error: Optional[AirbyteErrorTraceMessage] = Field(None, description="error trace message: the error object")


class AirbyteStream(BaseModel):
class Config:
extra = Extra.allow
Expand Down Expand Up @@ -246,6 +275,10 @@ class Config:
None,
description="schema message: the state. Must be the last message produced. The platform uses this information",
)
trace: Optional[AirbyteTraceMessage] = Field(
None,
description="trace message: a message to communicate information about the status and performance of a connector",
)


class AirbyteProtocol(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Type(Enum):
SPEC = "SPEC"
CONNECTION_STATUS = "CONNECTION_STATUS"
CATALOG = "CATALOG"
TRACE = "TRACE"


class AirbyteRecordMessage(BaseModel):
Expand Down Expand Up @@ -56,6 +57,25 @@ class Config:
message: str = Field(..., description="the log message")


class Type1(Enum):
ERROR = "ERROR"


class FailureType(Enum):
system_error = "system_error"
config_error = "config_error"


class AirbyteErrorTraceMessage(BaseModel):
class Config:
extra = Extra.allow

message: str = Field(..., description="A user-friendly message that indicates the cause of the error")
internal_message: Optional[str] = Field(None, description="The internal error that caused the failure")
stack_trace: Optional[str] = Field(None, description="The full stack trace of the error")
failure_type: Optional[FailureType] = Field(None, description="The type of error")


class Status(Enum):
SUCCEEDED = "SUCCEEDED"
FAILED = "FAILED"
Expand Down Expand Up @@ -133,6 +153,15 @@ class OAuthConfigSpecification(BaseModel):
)


class AirbyteTraceMessage(BaseModel):
class Config:
extra = Extra.allow

type: Type1 = Field(..., description="the type of trace message")
emitted_at: float = Field(..., description="the time in ms that the message was emitted")
error: Optional[AirbyteErrorTraceMessage] = Field(None, description="error trace message: the error object")


class AirbyteStream(BaseModel):
class Config:
extra = Extra.allow
Expand Down Expand Up @@ -231,6 +260,9 @@ class Config:
state: Optional[AirbyteStateMessage] = Field(
None, description="schema message: the state. Must be the last message produced. The platform uses this information"
)
trace: Optional[AirbyteTraceMessage] = Field(
None, description="trace message: a message to communicate information about the status and performance of a connector"
)


class AirbyteProtocol(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies {
// https://github.com/airbytehq/jsongenerator
implementation 'net.jimblackler.jsonschemafriend:core:0.11.2'
implementation 'org.mozilla:rhino-engine:1.7.14'
implementation group: 'com.github.airbytehq', name: 'jsongenerator', version: '1.0.0-pre'
implementation group: 'com.github.airbytehq', name: 'jsongenerator', version: '1.0.1'

testImplementation project(":airbyte-json-validation")
testImplementation project(':airbyte-test-utils')
Expand Down

0 comments on commit a294f40

Please sign in to comment.