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

Revert changes to Python code generation #1442

Closed
wants to merge 1 commit into from
Closed
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 python/svix/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ async def create(
with_content=False,
**options.to_dict(),
)
ret.payload = MessageOutPayload.from_dict(message_in.payload.to_dict())
ret.payload = message_in.payload
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ret.payload = message_in.payload
ret.payload = t.Cast(message_in.payload, t.Any)

Something like this?

return ret

async def get(self, app_id: str, msg_id: str) -> MessageOut:
Expand Down Expand Up @@ -1112,7 +1112,7 @@ def create(
with_content=False,
**options.to_dict(),
)
ret.payload = MessageOutPayload.from_dict(message_in.payload.to_dict())
ret.payload = message_in.payload
return ret

def get(self, app_id: str, msg_id: str) -> MessageOut:
Expand Down
2 changes: 1 addition & 1 deletion python/templates/model.py.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set class_name = model.class_info.name %}
{% if model.required_properties == [] and model.optional_properties == [] and False %}
{% if model.required_properties == [] and model.optional_properties == [] %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The revert looks correct, the and False looks silly and that it'll break stuff, so no wonder if broke stuff.

from typing import Any, Dict, Type, TypeVar

T = TypeVar("T", bound="{{ class_name }}")
Expand Down
Loading