Repository navigation
Fixes refi-qda import errors #1698 - #1699
Merged
Merged
Conversation
Describe the bug : On master dde0411, REFI-QDA Project import fails in four ways on four open-licence .qdpx exports from Zenodo: 7940122, MAXQDA 2020: master stores 410 of 751 codings with cid NULL; with the diff, 0 NULL. 14535515, MAXQDA 2022: master imports 0 of 17 PDFs and 0 of 363 PDF area codings, with 112 of 307 codings having cid NULL; with the diff, 17 PDFs, 358 of 363 area codings, 0 NULL. 7330414, MAXQDA 2022: master stops at refi.py:930 with sqlite3.IntegrityError: UNIQUE constraint failed: source.name after 68 of 127 sources; with the diff, 127 sources and 881 of 881 text codings. 19931638, ATLAS.ti 26.0: master stops at refi.py:1731 with UNIQUE constraint failed: annotation.fid, annotation.pos0, annotation.pos1, annotation.owner after 184 of 283 sources; with the diff, 283 sources and 5,224 of 5,226 codings. Causes, read from refi.py: Repeated code names. When code_name rejects a name that already exists, the existing cid is looked up but the new GUID is never added to self.codes, so that code's codings are inserted with cid None and appear under no code. This is the import side of Enhancement: Allow multiple (sub)codes with the same name #1531. As a stopgap, the diff maps the GUID to the existing code, which merges same-name codes. PDFSource without a Representation. All PDFs in both MAXQDA 2022 files have none. The source row is only created through load_text_source, so the PDF and its PDFSelection codings are skipped silently. The diff adds the row with empty text. Source names shared across types. Only text sources get a prefix; picture and PDF sources are inserted as named. 7330414 has 127 sources with 103 distinct names. The diff adds _2, _3 before the extension, before the file is copied, so each source keeps its own file. Repeated annotation (same source, span and owner): the insert has no guard. The diff skips it with a log line. To Reproduce : Download the .qdpx from one of the records. Project > Import > REFI-QDA Project import. Expected behavior : All sources and codings import, or skipped items are listed in the log.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
Describe the bug :
REFI-QDA Project import fails in four ways on four open-licence .qdpx exports from Zenodo:
7940122, MAXQDA 2020: master stores 410 of 751 codings with cid NULL; with the diff, 0 NULL.
14535515, MAXQDA 2022: master imports 0 of 17 PDFs and 0 of 363 PDF area codings, with 112 of 307 codings having cid NULL; with the diff, 17 PDFs, 358 of 363 area codings, 0 NULL.
7330414, MAXQDA 2022: master stops at refi.py:930 with sqlite3.IntegrityError: UNIQUE constraint failed: source.name after 68 of 127 sources; with the diff, 127 sources and 881 of 881 text codings.
19931638, ATLAS.ti 26.0: master stops at refi.py:1731 with UNIQUE constraint failed: annotation.fid, annotation.pos0, annotation.pos1, annotation.owner after 184 of 283 sources; with the diff, 283 sources and 5,224 of 5,226 codings. Causes, read from refi.py:
Repeated code names. When code_name rejects a name that already exists, the existing cid is looked up but the new GUID is never added to self.codes, so that code's codings are inserted with cid None and appear under no code.
This is the import side of Enhancement: Allow multiple (sub)codes with the same name #1531.
As a stopgap, the diff maps the GUID to the existing code, which merges same-name codes.
PDFSource without a Representation.
All PDFs in both MAXQDA 2022 files have none.
The source row is only created through load_text_source, so the PDF and its PDFSelection codings are skipped silently.
The diff adds the row with empty text. Source names shared across types. Only text sources get a prefix; picture and PDF sources are inserted as named.
7330414 has 127 sources with 103 distinct names. The diff adds _2, _3 before the extension, before the file is copied, so each source keeps its own file. Repeated annotation (same source, span and owner): the insert has no guard. The diff skips it with a log line.