Skip to content

Do not update 'files' reference when saving item #1055

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ml-evs
Copy link
Member

@ml-evs ml-evs commented Feb 25, 2025

I accidentally depended on an item having files saved in the db, where actually it should only be a field constructed for the API response. This crept through as calling save-item from the app included this field, and as it fits the pydantic model, it was being saved in the database.

We still need a better way of distinguishing such fields between the database and API, by adding special validators to the base entry types and annotating them as such in our models, but this just patches this problem for now.

@ml-evs ml-evs added the bug Something isn't working label Feb 25, 2025
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.35%. Comparing base (85088ec) to head (a90f53d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1055   +/-   ##
=======================================
  Coverage   71.35%   71.35%           
=======================================
  Files          63       63           
  Lines        4151     4151           
=======================================
  Hits         2962     2962           
  Misses       1189     1189           
Files with missing lines Coverage Δ
pydatalab/src/pydatalab/routes/v0_1/items.py 83.38% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

cypress bot commented Feb 25, 2025

datalab    Run #3206

Run Properties:  status check passed Passed #3206  •  git commit 9cfa9ff6f8 ℹ️: Merge a90f53dcc44a0c22821c6b98d46d6a6a09b8d7ef into 85088ec83d31e981cfb4aae7cca5...
Project datalab
Branch Review ml-evs/fix-files
Run status status check passed Passed #3206
Run duration 07m 42s
Commit git commit 9cfa9ff6f8 ℹ️: Merge a90f53dcc44a0c22821c6b98d46d6a6a09b8d7ef into 85088ec83d31e981cfb4aae7cca5...
Committer Matthew Evans
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 498
View all changes introduced in this branch ↗︎

@ml-evs ml-evs force-pushed the ml-evs/fix-files branch 2 times, most recently from 9218c19 to 7f7f8bb Compare February 25, 2025 19:01
@ml-evs ml-evs added the blocked label Feb 25, 2025
@ml-evs ml-evs marked this pull request as draft February 25, 2025 19:02
@ml-evs
Copy link
Member Author

ml-evs commented Feb 25, 2025

Actually, converting this to a draft to add proper tests and a more general solution at a later date.

@ml-evs ml-evs force-pushed the ml-evs/fix-files branch from 7f7f8bb to a90f53d Compare April 25, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant