Skip to content

Conversation

@VeckoTheGecko
Copy link
Collaborator

@VeckoTheGecko VeckoTheGecko commented Feb 20, 2025

Copied a test from 99955d7 as mentioned in #136.

The problem was that there was no deserialisation (i.e., "field validation" in pydantic terms) of the minutes to the timedelta objects (serialisation = model -> file, validation = file -> model). By default it treated the float as seconds.

Were there any other fields that are in minutes besides ADCPConfig.period, CTDConfig.stationkeeping_time, ShipUnderwaterSTConfig.period, and DrifterConfig.lifetime @erikvansebille and @ammedd ?

Careful when merging this into ship_spped_in_knots to make sure the new Drifter.period also gets a deserialisation method like included in this PR. fixed

Copy link
Collaborator

@ammedd ammedd left a comment

Choose a reason for hiding this comment

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

Looks good

@VeckoTheGecko VeckoTheGecko merged commit 68855d7 into main Feb 20, 2025
10 checks passed
@VeckoTheGecko VeckoTheGecko deleted the i136 branch February 20, 2025 14:26
@VeckoTheGecko VeckoTheGecko mentioned this pull request Feb 20, 2025
1 task
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.

Issue with pydantic.field_serializer not picking up conversion from minutes to seconds

3 participants