Skip to content

Pydantic Refactoring#279

Closed
robertbartel wants to merge 205 commits intomasterfrom
pydantic-serializable
Closed

Pydantic Refactoring#279
robertbartel wants to merge 205 commits intomasterfrom
pydantic-serializable

Conversation

@robertbartel
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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