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

Tuple field gets deserialized as list #291

Closed
aiven-anton opened this issue Apr 17, 2023 · 2 comments · Fixed by #296
Closed

Tuple field gets deserialized as list #291

aiven-anton opened this issue Apr 17, 2023 · 2 comments · Fixed by #296

Comments

@aiven-anton
Copy link

Describe the bug

Tuple fields are being deserialized as a list, instead of a tuple.

To Reproduce

@dataclass
class Header(AvroModel):
    key: bytes
    value: bytes

@dataclass
class Record(AvroModel):
    headers: Tuple[Header, ...]

Then round-trip a record through Record.deserialize(record.serialize()), and check type(record.headers).

Expected behavior

I expected a tuple field to be deserialized as a tuple.

@marcosschroh
Copy link
Owner

@aiven-anton thanks for reporting this issue. I have created a PR to fix it, you're welcome to test it.

marcosschroh added a commit that referenced this issue Apr 21, 2023
… rather than list. Closes #291 (#296)

Co-authored-by: Marcos Schroh <marcos.schroh@kpn.com>
@aiven-anton
Copy link
Author

@marcosschroh Amazing, I'll try out the fix! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants