Skip to content

Commit

Permalink
Merge pull request #280 from candleindark/enh-consts
Browse files Browse the repository at this point in the history
Avoid multiple assignments of constant `ALLOWED_INPUT_SCHEMAS`
  • Loading branch information
yarikoptic authored Feb 3, 2025
2 parents 6fd04fb + c44d1f3 commit c300776
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dandischema/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
"0.6.6",
"0.6.7",
"0.6.8",
DANDI_SCHEMA_VERSION,
]

# ATM we allow only for a single target version which is current
# migrate has a guard now for this since it cannot migrate to anything but current
# version
ALLOWED_TARGET_SCHEMAS = [DANDI_SCHEMA_VERSION]

# This allows multiple schemas for validation, whereas target schemas focus on
# migration.
ALLOWED_VALIDATION_SCHEMAS = ALLOWED_TARGET_SCHEMAS + ALLOWED_INPUT_SCHEMAS

if DANDI_SCHEMA_VERSION not in ALLOWED_INPUT_SCHEMAS:
ALLOWED_INPUT_SCHEMAS.append(DANDI_SCHEMA_VERSION)
ALLOWED_VALIDATION_SCHEMAS = sorted(
set(ALLOWED_INPUT_SCHEMAS).union(ALLOWED_TARGET_SCHEMAS)
)

0 comments on commit c300776

Please sign in to comment.