Skip to content

generate-metadata: handle nf-core schema patterns that crash it - #625

Open
rpinho wants to merge 1 commit into
latchbio:mainfrom
rpinho:fix-nfcore-schema-parsing
Open

rpinho wants to merge 1 commit into
latchbio:mainfrom
rpinho:fix-nfcore-schema-parsing

Conversation

@rpinho

@rpinho rpinho commented Nov 14, 2026

Copy link
Copy Markdown

latch generate-metadata --nextflow crashes on many current nf-core schemas. I ran parse_schema(strict=False) and get_python_type_inner on the nextflow_schema.json of 146 nf-core pipelines: 55 run through on main, 124 with this PR. The other 22 stop at a schema file that wasn't downloaded or isn't valid JSON, not in this code.

The fixes:

  • A type list like ["boolean", "string"] (the nf-core template's help parameter) raised ValueError, even with strict=False. It now raises SchemaParsingError, so non-strict mode warns and skips the parameter, as it does for other unsupported types. 71 pipelines.
  • Integer and number enums with a default raised TypeTransformerFailedError (fastqrepair, hadge, quantms).
  • A format: path parameter with a $projectDir/... default raised AttributeError (atacseq, chipseq, rnafusion, viralrecon, viralmetagenome).
  • A samplesheet schema that is a plain list of strings raised KeyError('properties') (fetchngs).
  • An empty-string enum value raised IndexError (diaproteomics, bacmodel).
  • Enum values +, - and ? mapped to the same identifier and collapsed into one choice (funcscan).

Test: 6 new test files fail on main (8 failed, 2 passed) and pass here. Full suite (without tests/test_ls.py, which needs a token): 78 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

Type lists, numeric enums with defaults, $projectDir path defaults,
string-list samplesheet schemas, empty enum values and symbol enum
values crashed parse_schema/get_python_type_inner. 124 of 146 current
nf-core schemas now run through, up from 55.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N
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