Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation fails for jsonschema version 4.18 #1569

Open
shashigharti opened this issue Jul 18, 2023 · 7 comments
Open

Validation fails for jsonschema version 4.18 #1569

shashigharti opened this issue Jul 18, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@shashigharti
Copy link
Contributor

shashigharti commented Jul 18, 2023

Overview

This fails in jsonschema version 4.18

schema = {
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Camera Trap Data Package Profile",
    "type": "object",
    "allOf": [
        {
         "$ref": "https://frictionlessdata.io/schemas/data-package.json"
        },
        {
          "required": [
            "multimedia_access",
            "project",
            "spatial",
            "temporal",
            "taxonomic"
          ]
        }
    ]  
}
descriptor = {'profile': 'camtrap.json', 'resources': [{'name': 'table', 'type': 'table', 'path': 'table.csv', 'scheme': 'file', 'format': 'csv', 'mediatype': 'text/csv'}]}
validator_class = jsonschema.validators.validator_for(schema)
validator = validator_class(schema)
for error in validator.iter_errors(descriptor):
    print(error)

# jsonschema.exceptions._WrappedReferencingError: Unresolvable: https://frictionlessdata.io/schemas/data-package.json

Due to that the following code fails:

from frictionless import Package, Resource, FrictionlessException
import pytest

profile = "camtrap.json"
resource = Resource(name="table", path="table.csv")
package = Package(resources=[resource], profile=profile)
with pytest.raises(FrictionlessException) as excinfo:
    package.to_descriptor(validate=True)
@shashigharti shashigharti added the bug Something isn't working label Jul 18, 2023
@pschumm
Copy link

pschumm commented Sep 2, 2023

I would just point out that jupyter_events has now moved to jsonschema v4.18.0, so this creates a problem for those using Frictionless within JupyterLab (for the moment, one can get around this by pinning jupyter_events<v0.7.0). My sense (based on a quick read) is that this is going to require some code changes to frictionless-py to make it compatible with the new API implemented in jsonschema>=4.18.0. Unfortunately I don't have time to work on this right now.

@johentsch
Copy link

so this creates a problem for those using Frictionless within JupyterLab

Yes I second that. Frictionless is a core dependency to our library, which is also designed for working well in Jupyter, so there is a dependency clash

frictionless 5.16.0 requires jsonschema<4.18

@johentsch
Copy link

Any prospects of this being addressed in the near future?

@zaneselvans
Copy link

I finally updated our project to use frictionless v5 rather than v4 and was also surprised to see jsonschema get downgraded to a version that's almost a year and a half old with the attendant downgrades of multiple Jupyter packages.

It would be great to get this updated!

@pschumm
Copy link

pschumm commented Apr 27, 2024

FYI, the latest JupyterLab releases (4.1.8 and 4.2.0rc0) now require jupyterlab_server 2.27.1, which itself requires jsonschema 4.18.0. So this is the end of the road for JupyterLab updates with Frictionless until this issue is addressed.

@pschumm
Copy link

pschumm commented Sep 9, 2024

I believe this issue can now be closed, since following 925cbb3 the jsonschema dependency is now

jsonschema>=4.20

@roll, do you agree?

@roll
Copy link
Member

roll commented Sep 16, 2024

Thanks, yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

5 participants