Skip to content

Fixes refi-qda import errors #1698 - #1699

Merged
ccbogel merged 1 commit into
masterfrom
REFI-QDA-fix
Nov 4, 2026
Merged

ccbogel merged 1 commit into
masterfrom
REFI-QDA-fix

Conversation

@ccbogel

@ccbogel ccbogel commented Nov 4, 2026

Copy link
Copy Markdown
Owner

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.

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.
@ccbogel
ccbogel merged commit 604c71b into master Nov 4, 2026
1 check passed
@ccbogel
ccbogel deleted the REFI-QDA-fix branch November 4, 2026 02:46
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