Skip to content

Use jsongenerator 1.0.1 #12554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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