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

Add missing Dataset field serializers #384

Merged
merged 4 commits into from
Jul 10, 2023
Merged

Conversation

aaraney
Copy link
Member

@aaraney aaraney commented Jul 10, 2023

fixes #377

Changes

@aaraney aaraney added the bug Something isn't working label Jul 10, 2023
@aaraney
Copy link
Member Author

aaraney commented Jul 10, 2023

This depends on #381

@robertbartel robertbartel added the maas MaaS Workstream label Jul 10, 2023
@robertbartel
Copy link
Contributor

@aaraney, I've marked the issue as no longer blocked. Probably this just needs the branch rebased.

@aaraney
Copy link
Member Author

aaraney commented Jul 10, 2023

@robertbartel, rebased and ready for review! Thanks in advance!

Copy link
Contributor

@robertbartel robertbartel left a comment

Choose a reason for hiding this comment

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

There's one thing that needs to be cleared up before I approve, although I probably am just missing something about how Pydantic works.

return value

field_serializers = {
"uuid": str,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think uuid should have something akin to the lambda used for manager_uuid, although perhaps it's declaration needs adjustment. That is:

uuid: Optional[UUID] = Field(default_factory=uuid4)

If I follow correctly, this implies the possibility of explicitly receiving None. It's possible there's a subtlety about Pydantic I'm missing that requires this to be declared as Optional even though it really isn't (although if that's the case, it's bothersome).

Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch. You are right. Changing that now.

@aaraney
Copy link
Member Author

aaraney commented Jul 10, 2023

Great catch! Thanks for the review, @robertbartel! I just pushed the required change. This is ready for another quick review.

@robertbartel robertbartel merged commit 6e40786 into NOAA-OWP:master Jul 10, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working maas MaaS Workstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add field_serializers for Dataset field without serializable types
2 participants