Skip to content

Fix pydantic json_encoders deprecation in BaseModel - #1227

Open
aagbsn wants to merge 7 commits into
masterfrom
fix_basemodel_deprecated_json_encoders
Open

aagbsn wants to merge 7 commits into
masterfrom
fix_basemodel_deprecated_json_encoders

Conversation

@aagbsn

@aagbsn aagbsn commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Fixes deprecation warning about json_encoders

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.87%. Comparing base (75664aa) to head (db00e53).
⚠️ Report is 1 commits behind head on master.

❌ Your project check has failed because the head coverage (94.87%) is below the target coverage (95.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1227      +/-   ##
==========================================
+ Coverage   92.42%   94.87%   +2.44%     
==========================================
  Files          86       58      -28     
  Lines        8599     5231    -3368     
  Branches      509      212     -297     
==========================================
- Hits         7948     4963    -2985     
+ Misses        541      237     -304     
+ Partials      110       31      -79     
Flag Coverage Δ
ooniauth 100.00% <ø> (ø)
oonifindings 97.32% <ø> (ø)
oonimeasurements ?
ooniprobe 91.28% <ø> (+0.94%) ⬆️
oonirun 98.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hellais hellais left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should add a few more tests for this specific use-case. I am also seeing that some of the existing tests are failing and it's unclear if some downstream consumers might break as a result of this.

One thing we should be extra careful of is that only one serializer can be defined per field, so I'm not sure if by defining a catch all field serialiser this might impact how subclasses of this base class which use serialisers work.

Some additional tests and validation for that could help address this concern as well.

@aagbsn

aagbsn commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Added regression tests to confirm that this PR does break backwards compatibility, and then fixed the regression.

@aagbsn
aagbsn requested a review from hellais September 18, 2026 16:58
@aagbsn
aagbsn marked this pull request as draft September 18, 2026 17:07
@aagbsn

aagbsn commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

There may be some additional endpoints that need tests to ensure no other regressions exist.

adds regression tests to validate API responses stay backwards
compatible to ooniauth, oonifindings, and oonirun services
@aagbsn

aagbsn commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

On this branch I rebased additional date format regression tests to verify that the services ooniauth, oonifindings, and oonirun were not affected by this change
https://github.com/ooni/backend/tree/test_datetime_regression

@aagbsn
aagbsn marked this pull request as ready for review September 19, 2026 10:11
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