labelbox-python icon indicating copy to clipboard operation
labelbox-python copied to clipboard

[PLT-600] Converted SDK to use pydantic V2

Open Gabefire opened this issue 1 year ago • 0 comments

Description

  • This is a complete converstion. Pydantic_compat .pyis removed, and all tests are running (3.8 lint test has underlying issues right now (all prs have this problem))
  • Removed Dropdown from annotation types. This has been fully removed from the editor since 2022. This cuts back on how much I need to convert over. The dropdown annotation type was only used for ontology creation
  • The LBV1 annotation import library sterilization tests (unit) do not work correctly but are related to export v1. The integration tests work fine, but fixing the main annotation library would take a full rewrite. I marked tests as skipped, but they are skipped because I can't get it to dump properly and remove None keys like the main library to match our existing tests. This is combined with export V1, which is being removed any day now. This should also be removed.
  • Pydantic V2 base model equality no longer works as expected because removing keys (uuid) changes the model's metadata. This can be overwritten, but it would require a lot of work. My tests get around this by checking different fields or dumping the model.

https://www.loom.com/share/d41facdaebdc425ab5ee12e94406f907

Type of change

Please delete options that are not relevant.

  • [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)

All Submissions

  • [x] Have you followed the guidelines in our Contributing document?
  • [x] Have you provided a description?
  • [x] Are your changes properly formatted?

New Feature Submissions

  • [x] Does your submission pass tests?
  • [x] Have you added thorough tests for your new feature?
  • [x] Have you commented your code, particularly in hard-to-understand areas?

Gabefire avatar Jul 19 '24 16:07 Gabefire