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

DM-47789: Move IP address normalization into a type #1172

Merged
merged 3 commits into from
Nov 27, 2024
Merged

Conversation

rra
Copy link
Member

@rra rra commented Nov 27, 2024

Using Pydantic IPvAnyAddress still appears to be more trouble than it's worth, but at least the internal IP address handling that produces a str can be moved into a Pydantic type rather than needing the more awkward field validator syntax.

rra added 3 commits November 26, 2024 16:13
Using Pydantic `IPvAnyAddress` still appears to be more trouble
than it's worth, but at least the internal IP address handling
that produces a `str` can be moved into a Pydantic type rather
than needing the more awkward field validator syntax.
Dual inheritance from `str` and `Enum` should generally be avoided
in favor of `StrEnum`, but in the case of `HealthStatus` a simple
enum is sufficient.
The `microseconds=True` argument to `current_datetime` makes it
equivalent to the much shorter and standard `datetime.now(tz=UTC)`.
Use the standard construction and reserve `current_datetime` for
the cases where we want to suppress the microseconds field.
@rra rra enabled auto-merge November 27, 2024 00:18
@rra rra merged commit 6e9bf9f into main Nov 27, 2024
5 checks passed
@rra rra deleted the tickets/DM-47789 branch November 27, 2024 00:25
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.

1 participant