Skip to content

Commit bdcc340

Browse files
committed
Merge branch 'main' into dev
2 parents 5e7d3c4 + 4c622f6 commit bdcc340

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11

2+
<a id='changelog-2.0.7'></a>
3+
# 2.0.7 — 2025-06-03
4+
5+
## Changed
6+
7+
- Handle TSV schema rules with missing or `n/a` values for `additional_columns`.
8+
29
<a id='changelog-"2.0.6"'></a>
310
# "2.0.6" — 2025-05-23
411

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ build = "cp39-*"
4343
skip = "*musllinux* *_i686 *-win32"
4444
build-frontend = "build"
4545

46-
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_24_x86_64:latest"
47-
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_24_aarch64:latest"
46+
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64:latest"
47+
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64:latest"
4848

4949
before-build = "curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh && deno --version"
5050
test-command = "bids-validator-deno --version"

src/schema/tables.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ export function evalAdditionalColumns(
239239
if (context.extension !== '.tsv') return
240240
const headers = Object.keys(context?.columns)
241241
if (rule.columns) {
242+
if (!rule.additional_columns || rule.additional_columns === 'n/a' ) {
243+
// Old schemas might be missing the field, so be permissive.
244+
// New schemas indicate it is not applicable with 'n/a'.
245+
return
246+
}
242247
const ruleHeadersNames = Object.keys(rule.columns).map(
243248
// @ts-expect-error
244249
(x) => schema.objects.columns[x].name,
@@ -250,11 +255,11 @@ export function evalAdditionalColumns(
250255
if (rule.additional_columns?.startsWith('allowed')) {
251256
extraCols = extraCols.filter((header) => !(header in context.sidecar))
252257
}
253-
const code = rule.additional_columns === 'allowed'
254-
? 'TSV_ADDITIONAL_COLUMNS_UNDEFINED'
258+
const code = rule.additional_columns === 'not_allowed'
259+
? 'TSV_ADDITIONAL_COLUMNS_NOT_ALLOWED'
255260
: rule.additional_columns === 'allowed_if_defined'
256261
? 'TSV_ADDITIONAL_COLUMNS_MUST_DEFINE'
257-
: 'TSV_ADDITIONAL_COLUMNS_NOT_ALLOWED'
262+
: 'TSV_ADDITIONAL_COLUMNS_UNDEFINED'
258263
const issue = {
259264
code,
260265
location: context.path,

0 commit comments

Comments
 (0)