Skip to content
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

fix(back): use uuid instead of imported id, for items and objects. keep original id #55

Merged

Conversation

BertrandRenault
Copy link
Contributor

@BertrandRenault BertrandRenault commented Jan 22, 2024

This is a draft for using shortuuid instead of original id in coco_importer, to ensure id unicity

  • keep original id
  • ensure objects id unicity too
  • apply to all importers
  • fix tests
  • put back original_id in exporters

should fix #50

@BertrandRenault BertrandRenault added bug: minor Minor issues, minimal user impact scope: back Related to Pixano backend labels Jan 22, 2024
@BertrandRenault BertrandRenault self-assigned this Jan 22, 2024
@BertrandRenault
Copy link
Contributor Author

BertrandRenault commented Jan 23, 2024

Some tests are based on id (original data id), so generating a shortuuid id breaks theses tests.
Maybe we can add an "id_field" parameter in dataset.load_item() to select by 'original_id' instead of 'id' ?

@cpvannier
Copy link
Member

It is probably best to access the table directly with Lance to retrieve the generated UUIDs.

This will allow calling the endpoints in the same way that the frontend does, which is what we want to validate with these tests.

@BertrandRenault BertrandRenault changed the title fix(back): coco_importer with uuid fix(back): use uuid instead of imported id, for items and objects. keep original id Jan 23, 2024
@BertrandRenault BertrandRenault marked this pull request as ready for review January 23, 2024 16:59
@BertrandRenault BertrandRenault marked this pull request as draft January 23, 2024 17:08
@BertrandRenault BertrandRenault marked this pull request as ready for review January 23, 2024 17:36
pixano/data/importers/coco_importer.py Outdated Show resolved Hide resolved
@BertrandRenault BertrandRenault merged commit a24ee97 into pixano:develop Jan 24, 2024
5 checks passed
@cpvannier cpvannier added this to the Pixano 0.5.0 milestone Jan 24, 2024
@cpvannier cpvannier added bug: major Major issues, significant user impact and removed bug: minor Minor issues, minimal user impact labels Feb 14, 2024
cpvannier pushed a commit that referenced this pull request Feb 15, 2024
…ep original id (#55)

* fix(back): coco_importer with uuid

* fix(back): keep original_id, uuid for objects, all importers

* fix(tests): adapt tests to uuid ids

* fix(back): adapt tests + lookup in tables with id_list from first table select

* fix(test): format

* fix(back): if exists, export original_id to id

* fix(back): make original_id generic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: major Major issues, significant user impact scope: back Related to Pixano backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when using COCOImporter with multiple splits.
3 participants