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

Merged
merged 1 commit into from
May 15, 2025
Merged

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 70.90%. Comparing base (1168939) to head (7cc960b).
⚠️ Report is 89 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1055   +/-   ##
=======================================
  Coverage   70.90%   70.90%           
=======================================
  Files          64       64           
  Lines        4276     4276           
=======================================
  Hits         3032     3032           
  Misses       1244     1244           
Files with missing lines Coverage Δ
pydatalab/src/pydatalab/routes/v0_1/items.py 82.00% <ø> (ø)
🚀 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 #3314

Run Properties:  status check passed Passed #3314  •  git commit cf8509f786 ℹ️: Merge 7cc960bd01d7e80505a5c7a43aba69d87b0e684a into 116893914cf81cccdfdb3e7f9416...
Project datalab
Branch Review ml-evs/fix-files
Run status status check passed Passed #3314
Run duration 08m 30s
Commit git commit cf8509f786 ℹ️: Merge 7cc960bd01d7e80505a5c7a43aba69d87b0e684a into 116893914cf81cccdfdb3e7f9416...
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 504
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
@ml-evs ml-evs force-pushed the ml-evs/fix-files branch from a90f53d to ca028c5 Compare May 14, 2025 15:25
@ml-evs ml-evs removed the blocked label May 14, 2025
@ml-evs ml-evs marked this pull request as ready for review May 14, 2025 16:18
@ml-evs ml-evs force-pushed the ml-evs/fix-files branch from ca028c5 to 0a22f92 Compare May 15, 2025 13:09
@ml-evs ml-evs mentioned this pull request May 15, 2025
@ml-evs ml-evs force-pushed the ml-evs/fix-files branch from 0a22f92 to 7cc960b Compare May 15, 2025 14:58
@ml-evs ml-evs merged commit c3192e7 into main May 15, 2025
17 checks passed
@ml-evs ml-evs deleted the ml-evs/fix-files branch May 15, 2025 17:04
BenjaminCharmes added a commit that referenced this pull request May 16, 2025
author Benjamin CHARMES <benjamin.charmes@gmail.com> 1747149404 +0200
committer Benjamin CHARMES <benjamin.charmes@gmail.com> 1747395376 +0200

Upgrade Bootstrap 5, better mobile optimisation, refactor e2e tests and tidy up!

Add two more components

Fix cypress test with new classes

Open Modal faster to try to fix Electron cypress test

Add the old Modal

Re-add new Modal to check which tests fails

Update e2e test batchSampleFeature to check that Modal is open before typing

Update cypress commands to close Modal

Update cypress commands to close Modal

Fix uppercase typo

Fix uppercase typo

Fix getSubmitButton

Fix cypress e2e

Fix cypress e2e

Final cypress fix

Improving column management in Datatable (#1170)

Co-authored-by: Matthew Evans <git@ml-evs.science>

Resolve conflicts

Resolve conflicts

Refactor e2e tests

Fix typo in sampleTablePage

Fix typo in sampleTablePage

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

Improving column management in Datatable (#1170)

Co-authored-by: Matthew Evans <git@ml-evs.science>

Resolve conflicts

Remove 'boostrap'

Fix search bar height
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant