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

Upgrade protobuf to >=5.0,<6.0 #219

Merged
merged 4 commits into from
Nov 19, 2024
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
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20241112-133750.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Upgrade protobuf to <=5.0
time: 2024-11-12T13:37:50.886196-05:00
custom:
Author: gshank
Issue: "218"
7 changes: 5 additions & 2 deletions dbt_common/events/base_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,18 @@ def __getattr__(self, key):

def to_dict(self):
return MessageToDict(
self.pb_msg, preserving_proto_field_name=True, including_default_value_fields=True
self.pb_msg,
preserving_proto_field_name=True,
always_print_fields_with_no_presence=True,
)

def to_json(self) -> str:
return MessageToJson(
self.pb_msg,
preserving_proto_field_name=True,
including_default_value_fields=True,
always_print_fields_with_no_presence=True,
indent=None,
sort_keys=True,
)

def level_tag(self) -> EventLevel:
Expand Down
2 changes: 1 addition & 1 deletion dbt_common/events/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def msg_to_dict(msg: EventMsg) -> dict:
msg_dict = MessageToDict(
msg,
preserving_proto_field_name=True,
including_default_value_fields=True, # type: ignore
always_print_fields_with_no_presence=True,
)
except Exception as exc:
event_type = type(msg).__name__
Expand Down
18 changes: 14 additions & 4 deletions dbt_common/events/types_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies = [
"Jinja2>=3.1.3,<4",
"mashumaro[msgpack]>=3.9,<4.0",
"pathspec>=0.9,<0.13",
"protobuf>=4.0.0,<5.0.0",
"protobuf>=5.0,<6.0",
"python-dateutil>=2.0,<3.0",
"requests<3.0.0", # needs to match dbt-core
"typing-extensions>=4.4,<5.0",
Expand All @@ -51,7 +51,7 @@ lint = [
"pytest>=7.3,<8.0", # needed for linting tests
"types-Jinja2>=2.11,<3.0",
"types-jsonschema>=4.17,<5.0",
"types-protobuf>=4.24,<5.0",
"types-protobuf>=5.0,<6.0",
"types-python-dateutil>=2.8,<3.0",
"types-PyYAML>=6.0,<7.0",
"types-requests"
Expand Down
Loading