Hey guys, when I have numeric patient IDs in the s...
# sarek
t
Hey guys, when I have numeric patient IDs in the samplesheet, I get a validation error:
Error for field 'patient' (1234): Value is [integer] but should be [string] (Patient ID must be provided, cannot contain spaces and must be a string value)
I remember that this issue had been discussed (maybe a couple years ago?), but I don't remember if this had been resolved (and I'm looking at a regression) or not (tried to search, but can't find it). Can someone please remind me? Thank you!
🚫 1
m
I honestly don't remember from the top of my head
which Nextflow version are you using?
this could be indeed either both a regression or something not actually resolved
Nextflow is definitively a bit to strict into numbers that could actually be strings too
I don't think we actually test for that, so we might simply not have implemented it. As we're planning a release, this should be an easy fix I believe
@Rike Hanssen @Famke Bäuerle any memory about this by any chance?
f
I do not recall but we can fix that, easy workaround is to just add a string to the numbers but thats a bit cumbersome
m
I was thinking more about fixing it in the pipeline by adding anyOf integer and string in the schema. that would work, right @Nicolas Vannieuwkerke?
n
Just use
"type": ["string", "integer"]
to allow both types
👍 1
or ideally use a YAML or JSON samplesheet as those file types have typing built-in
this is also nothing related to Nextflow but is fully nf-schema
m
nevermind
r
this feels like a new strict syntax thing
n
no this is an old 'issue' since nf-schema 2.0
thankyou 1
r
interesting we only ran into it now. I was thinking of the new thing where everything is interpreted as string
n
Yeah it only happens when you give an integer value in a string field via a CSV or TSV samplesheet. So it's a pretty uncommon issue 😛
t
Thank you, everyone! I will prefix a string for now, but it would be nice for that to be fixed eventually. I have some memory that it happened before (to someone else), but it is rare enough that we all apparently forgot about it. (I am running Nextflow 25.10.2, but as Nicolas said, that should not matter here.)
n
This cannot be 'fixed' as it is intended behaviour. nf-schema cannot know what the types are in CSV and TSV files so it tries to infer them. This does cause some false positives that are very hard to mitigate. (hence why I always suggest people to just use YAML files 😅)
t
What I mean by "fixed" is to adjust the validation to also allow integers in addition to strings, like you suggested. The big advantage of CSV/TSV over YAML/JASON is that you can make one in Excel, which for some users makes a huge difference. (Personally, I use a script to make samplesheets, so it doesn't matter to me.)
v
Yea this is definitely an issue for me too, would be great if integer ids could be supported. Not sure if it needs to be implemented at the nf-schema level though