Skip to content

WIP-Katsu: new dataset model in katsu#665

Draft
SanjeevLakhwani wants to merge 29 commits intodevelopfrom
feat/new-dataset-model
Draft

WIP-Katsu: new dataset model in katsu#665
SanjeevLakhwani wants to merge 29 commits intodevelopfrom
feat/new-dataset-model

Conversation

@SanjeevLakhwani
Copy link
Copy Markdown
Collaborator

No description provided.

SanjeevLakhwani and others added 22 commits January 26, 2026 14:46
Add a mixin that enables Django models to split Pydantic schema fields
between actual database columns and a JSONB field, with methods to
convert between schema and model instances.
Switch bento-lib dependency from PyPI release to git branch to pull in
new dataset model schema and related features.
Ensures proper JSON serialization of complex types (datetime, etc.)
when storing in JSONB columns.
Introduces DatasetV2 using PydanticJSONBMixin for hybrid column/JSONB
storage based on bento_lib's DatasetModel schema. Key columns are
indexed for efficient querying while full payload is stored in JSONB.

Also renames old Dataset.project related_name to datasets_old to
prepare for migration.
- Add DatasetV2Serializer with Pydantic validation on input and
  schema-based output representation
- Add DatasetV2ViewSet with project_id filtering support
- Register /datasets_v2 endpoint in REST API urls
Adds a Django management command that converts legacy Dataset records
into DatasetV2 using a best-effort mapping from DATS-style fields to
ProjectScopedDatasetModel. Supports --dry-run, --skip-existing,
--force-placeholder, --language, and --dataset-id options.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 43.14721% with 112 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.74%. Comparing base (c36aaa7) to head (e84f5bc).
⚠️ Report is 10 commits behind head on develop.

Files with missing lines Patch % Lines
...d_metadata_service/common/mixins/pydantic_mixin.py 36.26% 58 Missing ⚠️
chord_metadata_service/chord/api_views.py 27.94% 49 Missing ⚠️
chord_metadata_service/chord/serializers.py 75.00% 4 Missing ⚠️
chord_metadata_service/chord/models.py 94.44% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #665      +/-   ##
===========================================
- Coverage    94.52%   92.74%   -1.79%     
===========================================
  Files          135      136       +1     
  Lines         5515     5705     +190     
  Branches       523      542      +19     
===========================================
+ Hits          5213     5291      +78     
- Misses         212      324     +112     
  Partials        90       90              

☔ View full report in Codecov by Sentry.
📢 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.

@SanjeevLakhwani SanjeevLakhwani changed the title WIP: new dataset model in katsu WIP-Katsu: new dataset model in katsu Apr 1, 2026
Replace composite (identifier, language) primary key with identifier-only PK.
Add DatasetV2Translation model for non-default-language provenance data with
full CRUD API at /datasets_v2/<id>/translations[/<lang>]. Fix project_id bug
in update/destroy authz checks.
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.

1 participant