Skip to content

Commit

Permalink
import ValidationError from asdf, drop jsonschema as a dependency (#295)
Browse files Browse the repository at this point in the history
* import ValidationError from asdf, drop jsonschema as a dependency

* add changelog entry

* fix import order

* incraese minimum asdf-transform-schemas version

* add attempt to import ValidationError

first try to import ValidationError from
asdf.exceptions then fallback to importing
from the top level asdf if this fails.

* sort imports

* add changelog entry

* add comment about ValidationError import
  • Loading branch information
braingram authored Oct 13, 2023
1 parent 9696c7c commit b6cb4c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog/295.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Import ValidationError from asdf, drop jsonschema as a dependency.
8 changes: 7 additions & 1 deletion dkist/dataset/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
from pathlib import Path
from functools import singledispatch

from jsonschema.exceptions import ValidationError
from parfive import Results

import asdf

try:
# first try to import from asdf.exceptions for asdf 2.15+
from asdf.exceptions import ValidationError
except ImportError:
# fall back to top level asdf for older versions of asdf
from asdf import ValidationError


@singledispatch
def load_dataset(target):
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ install_requires =
parfive[ftp]>=1.5
sunpy[net,asdf]>=4.0.7
setuptools>=59
jsonschema>=3.2
aiohttp>=3.6
tqdm>=4.63
setup_requires = setuptools_scm
Expand Down

0 comments on commit b6cb4c1

Please sign in to comment.