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

Remove pydantic-based Definitions of Structures #875

Merged
merged 6 commits into from
Feb 11, 2025

Conversation

genematx
Copy link
Contributor

Since the issue in pydantic has been fixed, we can now use dataclasses-based strcutures for arrays, tables, etc.

Checklist

  • Add a Changelog entry
  • Add the ticket number which this PR closes to the comment section

@genematx genematx requested a review from danielballan January 31, 2025 15:15
@danielballan
Copy link
Member

For posterity, this is the justification for maintaining pydantic copies of these classes, pulled from a module docstring, which no longer applies:

The ArrayStructure class in tiled.structure.array is implemeneted with Python
built-in dataclasses. This is an implementation of the same structure in pydantic.
FastAPI requires pydantic models specifically, and will attempt to automatically
convert dataclasses to pydantic models. This normally works fine, but in the
case of ArrayStructure specifically it fails because of this issue:

pydantic/pydantic#3251

Once this problem is fixed in pydantic, this separate implementation in
ArrayStructure will no longer by needed. We will turn this module into a shim
that just imports ArrayStructure from tiled.structures.array and then deprecate
it.

@danielballan danielballan merged commit b930100 into bluesky:main Feb 11, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants