Skip to content

Conversation

alvarolopez
Copy link
Member

Description

Move Pydantic models to V2.

@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Attention: Patch coverage is 87.87879% with 16 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (master@e40e883). Click here to learn what that means.

Files Patch % Lines
caso/record.py 91.26% 7 Missing and 4 partials ⚠️
caso/extract/openstack/cinder.py 20.00% 4 Missing ⚠️
caso/extract/openstack/nova.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master     #119   +/-   ##
=========================================
  Coverage          ?   53.76%           
=========================================
  Files             ?       23           
  Lines             ?     1129           
  Branches          ?      115           
=========================================
  Hits              ?      607           
  Misses            ?      510           
  Partials          ?       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alvarolopez alvarolopez force-pushed the pydantic2 branch 2 times, most recently from 9acd943 to 1e38b70 Compare June 7, 2023 11:40
@alvarolopez alvarolopez marked this pull request as draft June 7, 2023 11:41
@thebe14
Copy link

thebe14 commented Sep 22, 2023

@alvarolopez any idea when this will be merged? I am waiting on this one since months.

@alvarolopez
Copy link
Member Author

@thebe14 Pydantic 2 was released only at the end of June (https://docs.pydantic.dev/2.0/blog/pydantic-v2-final/). We need to double check that everything works as expected.

@alvarolopez
Copy link
Member Author

@aidaph can you check everything is working as expected? LGTM.

@aidaph aidaph marked this pull request as ready for review May 9, 2024 09:40
Copy link

@aidaph aidaph left a comment

Choose a reason for hiding this comment

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

Few changes are added to make the extract of records works. LGTM now.

alvarolopez and others added 11 commits September 27, 2024 11:46
Pydantic 2 has breaking API changes, the most important for us is the
usage of compute_fields.

The accounting system expects datetime fields to be returned as integers
(i.e. epoch). We can use computed_fields for that, using properties.
This way we can internally store datetime objects, and just conver them
to integers when they are accessed. In order to do so, we define _epoch
properties.
@alvarolopez alvarolopez merged commit 4ed35c4 into master Sep 27, 2024
16 of 17 checks passed
@alvarolopez alvarolopez deleted the pydantic2 branch September 27, 2024 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block storage reported in GBytes instead of Bytes Remove workaround for computed fields

3 participants