Skip to content

fix(uniprot): batches cut by the plugin, so a TrEMBL batch fits one request - #1291

Merged
frapercan merged 1 commit into
integration/three-familiesfrom
fix/metadata-batches-fit-the-url
Nov 22, 2026
Merged

frapercan merged 1 commit into
integration/three-familiesfrom
fix/metadata-batches-fit-the-url

Conversation

@frapercan

Copy link
Copy Markdown
Owner

What

  • resolve_protein_metadata and both passes of resolve_protein_sequences (the sequences and the audit dates) cut their batches with the plugin's accession_batches. Each pass uses the same fields its own request asks for.
  • protea-sources is pinned to 956c6e66 (protea-sources feat(services): F2D embeddings CAFA TSV + delete extraction (router <400) #43), which adds accession_batches and MAX_REQUEST_TARGET. The lock file changes only that reference and its content hash.

Why

The first smoke run of resolve_protein_metadata (2,000 accessions, after #1290 was deployed) failed on its first batch with 414 Request-URI Too Long.

  • The batch was 1,000 ten-character TrEMBL accessions with 26 fields, an 11,348-character request target.
  • Measured against the service, UniProt answers a target of 8,191 characters and refuses one of 8,202.
  • The count of 1,000 is only one of the accessions endpoint's two limits.

The fields are part of the target, so batching with any fields other than the request's would cut the wrong batches. resolve_protein_sequences had the same latent failure on any run of TrEMBL accessions.

How it was checked

  • TestEveryBatchFitsOneRequest in both test files pins that each pass sends exactly accession_batches(population, fields=<its fields>). It also checks that 1,000 or 1,500 ten-character accessions are no longer sent as one or two requests.
  • pytest --with-postgres on test_resolve_protein_metadata.py, test_resolve_protein_sequences.py and test_current_metadata_stays_out_of_experiments.py: 61 passed, run against the plugin's merged code.
  • Lint gates pass (ruff format, ruff check, smell budget, sets gate, OpenAPI references), and mypy finds no issues in the two operations.
  • After merge, the metadata smoke run is repeated on dev before the full pass.

…equest

The first smoke run of resolve_protein_metadata failed on its first batch
with 414 Request-URI Too Long. The batch was 1,000 ten-character TrEMBL
accessions with 26 fields, an 11,348-character request target, and UniProt
answers 8,191 characters and refuses 8,202 (measured against the service).
The count of 1,000 is only one of the accessions endpoint's two limits.

protea-sources #43 adds accession_batches, which cuts by both limits, and
both operations that batch accessions now use it with the fields their own
request asks for, since the fields are part of the target:
resolve_protein_metadata, and the sequence and date passes of
resolve_protein_sequences, which had the same latent failure on a run of
TrEMBL accessions. The plugin is pinned to 956c6e66.

Tests pin that each pass sends exactly the plugin's batches for its own
fields, and that 1,000 or 1,500 ten-character accessions no longer go as
one or two requests.
@frapercan
frapercan marked this pull request as ready for review November 22, 2026 15:07
@frapercan
frapercan merged commit cee1a30 into integration/three-families Nov 22, 2026
20 of 21 checks passed
@frapercan
frapercan deleted the fix/metadata-batches-fit-the-url branch November 22, 2026 15:07
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