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

Pydantic Refactoring #279

Closed
wants to merge 205 commits into from
Closed

Pydantic Refactoring #279

wants to merge 205 commits into from

Conversation

robertbartel
Copy link
Contributor

@robertbartel robertbartel commented Feb 22, 2023

Merging of Pydantic work into master branch. See previous PRs to the associated feature branch tracked under #254.

This PR is blocked by #278, as the code from that PR (and its predecessors) needs to be included here. As a result, the branch for this PR is going to have a force-push or two for rebasing that work once things are complete (although much of that is already done and staged in another branch).

Subtypes of this enum variant that are embedded in a pydantic model will be:
  - coerced into an enum instance using member name (case insensitive)
  - and expose member names (upper case) in model json schema.
reasons why dict is overridden here:
pydantic will serialize from inner types outward, serializing each type
as a dictionary, list, or primitive and replacing its previous type with
the new "serialized" type. Consequently, this means hashable container
types like tuples and frozensets that contain values that "serialize" to
a non-hashable type (non-primitive, in this case) will raise a
`TypeError: unhashable type: 'dict'`. In the case of PartitionConfig,
FronzenSet[Partition] "serializes" inner Partition types as dictionaries
which are not hashable. To get around this, we will momentarily swap the
`partitions` field for a non-hashable container type, serialize using
`.dict()`, and swap back in the original `partitions` container.
@aaraney
Copy link
Member

aaraney commented Feb 22, 2023

Thanks for carefully considering how we need to merge this work and spearheading the effort. LMK how I can help.

aaraney added a commit to aaraney/DMOD that referenced this pull request Apr 17, 2023
aaraney added a commit to aaraney/DMOD that referenced this pull request Apr 24, 2023
…ved although we may want to merge the work
@robertbartel
Copy link
Contributor Author

Closing in favor of the more up to date #331.

aaraney added a commit to aaraney/DMOD that referenced this pull request Jun 9, 2023
…ved although we may want to merge the work
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