-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(signal schema): serialize base classes for custom types #777
base: main
Are you sure you want to change the base?
Conversation
3e7173a
to
9a7d439
Compare
Deploying datachain-documentation with Cloudflare Pages
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #777 +/- ##
==========================================
+ Coverage 87.33% 87.36% +0.02%
==========================================
Files 116 116
Lines 11147 11179 +32
Branches 1532 1539 +7
==========================================
+ Hits 9735 9766 +31
Misses 1032 1032
- Partials 380 381 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
9a7d439
to
a7d5da1
Compare
a7d5da1
to
67b9843
Compare
67b9843
to
a8e673f
Compare
a8e673f
to
eb8b9cf
Compare
eb8b9cf
to
a2d3742
Compare
a2d3742
to
6ac622b
Compare
6ac622b
to
7d188a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this update, looks good, tests are awesome! 👍
Fixes https://github.com/iterative/studio/issues/11140 (private repo).
If we have a class hierarchy:
We want for the
VideoInterval
class to have enough information about its base classFile
to be available after we serialize / deserialize it. For downstream tools to be able to work with it like aFile
(e.g. preview in Studio).Also, this PR fixes an existing issue with schema - complex types like
list[MyType]
were not properly handled during serialization / deserialization (and it was returninglist[Any]
).Fix Description
It adds
bases
field to the_custom_types
dict that we serialize to preserve fields and their types.bases
includes all base classes, their names, etc. When we deserialize we take the first registered in the ModelStore and pass it as a base to Pydantic create model:Demo
Screen.Recording.2025-01-03.at.8.31.02.PM.mov
TODO: