Repository navigation
fix(uniprot): batches cut by the plugin, so a TrEMBL batch fits one request - #1291
Merged
frapercan merged 1 commit intoNov 22, 2026
Merged
Conversation
…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.
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.
What
resolve_protein_metadataand both passes ofresolve_protein_sequences(the sequences and the audit dates) cut their batches with the plugin'saccession_batches. Each pass uses the same fields its own request asks for.protea-sourcesis pinned to956c6e66(protea-sources feat(services): F2D embeddings CAFA TSV + delete extraction (router <400) #43), which addsaccession_batchesandMAX_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 with414 Request-URI Too Long.The fields are part of the target, so batching with any fields other than the request's would cut the wrong batches.
resolve_protein_sequenceshad the same latent failure on any run of TrEMBL accessions.How it was checked
TestEveryBatchFitsOneRequestin both test files pins that each pass sends exactlyaccession_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-postgresontest_resolve_protein_metadata.py,test_resolve_protein_sequences.pyandtest_current_metadata_stays_out_of_experiments.py: 61 passed, run against the plugin's merged code.ruff format,ruff check, smell budget, sets gate, OpenAPI references), and mypy finds no issues in the two operations.