Skip to content

A gene symbol with a Lucene special character would abort the whole corpus run #272

Description

@realmarcin

Adversarial review of #260. Latent, not live — filed so it is on the record.

q = f"(gene_exact:{symbol}) AND (taxonomy_id:{taxon_id}) AND (reviewed:true)"

The symbol goes into the query string unescaped and unvalidated. urlencode
escapes it for the URL, but not for UniProt's query syntax: a symbol
containing :, (, ), " or a space produces a malformed query and an HTTP
400.

Since the #263 fix, a 4xx is raised immediately rather than retried — correct in
itself, but it means one odd symbol aborts the entire corpus run at whatever
record it reaches, after writing some records and not others.

Not currently reachable: every gene_symbols value in the corpus matches
[A-Za-z0-9_-]+ (checked across all 53 records, all components). It becomes
reachable the first time someone curates a symbol like atpB/E.

Fix: validate the symbol against that character class before querying and report
it as a decline, the way every other shortfall in this adapter is reported.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions