Skip to content
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

generate AirbyeTraceMessage.type enum with descriptive class name #12581

Merged
merged 4 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
4 changes: 2 additions & 2 deletions airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Config:
message: str = Field(..., description="the log message")


class Type1(Enum):
class TraceType(Enum):
ERROR = "ERROR"


Expand Down Expand Up @@ -161,7 +161,7 @@ class AirbyteTraceMessage(BaseModel):
class Config:
extra = Extra.allow

type: Type1 = Field(..., description="the type of trace message")
type: TraceType = Field(..., description="the type of trace message", title="trace type")
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")

Expand Down
1 change: 1 addition & 0 deletions airbyte-cdk/python/bin/generate-protocol-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function main() {
docker run --user "$(id -u):$(id -g)" -v "$ROOT_DIR":/airbyte airbyte/code-generator:dev \
--input "/airbyte/$YAML_DIR/$filename_wo_ext.yaml" \
--output "/airbyte/$OUTPUT_DIR/$filename_wo_ext.py" \
--use-title-as-name \
--disable-timestamp
done
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Config:
message: str = Field(..., description="the log message")


class Type1(Enum):
class TraceType(Enum):
ERROR = "ERROR"


Expand Down Expand Up @@ -157,7 +157,7 @@ class AirbyteTraceMessage(BaseModel):
class Config:
extra = Extra.allow

type: Type1 = Field(..., description="the type of trace message")
type: TraceType = Field(..., description="the type of trace message", title="trace type")
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")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function main() {
docker run --user "$(id -u):$(id -g)" -v "$ROOT_DIR":/airbyte airbyte/code-generator:dev \
--input "/airbyte/$YAML_DIR/$filename_wo_ext.yaml" \
--output "/airbyte/$OUTPUT_DIR/$filename_wo_ext.py" \
--use-title-as-name \
--disable-timestamp
done
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ definitions:
- emitted_at
properties:
type:
title: "trace type" # this title is required to avoid python codegen conflicts with the "type" parameter in AirbyteMessage. See https://github.com/airbytehq/airbyte/pull/12581
description: "the type of trace message"
type: string
enum:
Expand Down