labelbox-python
labelbox-python copied to clipboard
[PLT-600] Remove hacks and simplified annotation import library
Description
- Pulling pieces out of Pydantic v2 converstion. This one is REQUIRED for pydantic v2 because it does not support a previous hack
- This solution replaces the hack mentioned with a registry system that infers base models. This is still slightly complicated, but I put plenty of comments. It is also less complicated than depending on the order of models for stuff to work or having complicated parts of the code spread among multiple files. (it's contained to this one area)
- All test run without changing anything inside the test library
- I think getting base models from dicts is unnecessary, but we need to keep backwards compat
Type of change
Please delete options that are not relevant.
- [x] Bug fix (non-breaking change which fixes an issue)
All Submissions
- [x] Have you followed the guidelines in our Contributing document?
- [x] Have you provided a description?
- [x] Are your changes properly formatted?