Skip to content

Fixes for custom schemas#1931

Merged
braingram merged 6 commits into
asdf-format:mainfrom
braingram:custom_schema
Jul 9, 2025
Merged

Fixes for custom schemas#1931
braingram merged 6 commits into
asdf-format:mainfrom
braingram:custom_schema

Conversation

@braingram
Copy link
Copy Markdown
Contributor

@braingram braingram commented Jun 11, 2025

Description

Fix a few issues for custom schemas.

The main issue fixed (where custom schema is not used for write_to) is fixed by changing schema.validate to use a custom schema if one exists for the provided AsdfFile instance passed in as the ctx argument (Fixes: #1860).

The use of AsdfFile._custom_schema in schema.validate has the benefit of removing a duplicate validation that occurs when a custom schema is provided (Fixes: #1899).

The weldx downstream failures are unrelated (and appear to be due to a pint-xarray update): BAMWelDX/weldx#990

I also updated the jwst downstream tests to run serially since they are running into crds reference file download conflicts.

Tasks

  • run pre-commit on your machine
  • run pytest on your machine
  • Does this PR add new features and / or change user-facing code / API? (if not, label with no-changelog-entry-needed)
    • write news fragment(s) in changes/: echo "changed something" > changes/<PR#>.<changetype>.rst (see below for change types)
    • update relevant docstrings and / or docs/ page
    • for any new features, add unit tests
news fragment change types...
  • changes/<PR#>.feature.rst: new feature
  • changes/<PR#>.bugfix.rst: bug fix
  • changes/<PR#>.doc.rst: documentation change
  • changes/<PR#>.removal.rst: deprecation or removal of public API
  • changes/<PR#>.general.rst: infrastructure or miscellaneous change

@braingram braingram marked this pull request as ready for review June 12, 2025 14:21
@braingram braingram requested a review from a team as a code owner June 12, 2025 14:21
Copy link
Copy Markdown
Contributor

@nden nden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@braingram braingram merged commit 8e807f8 into asdf-format:main Jul 9, 2025
52 checks passed
@braingram braingram deleted the custom_schema branch July 9, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Providing a custom_schema results in 2x validation custom_schema not used on write_to

2 participants