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

Using old version of csvcubed with new $schema #884

Open
SarahJohnsonONS opened this issue Sep 5, 2023 · 1 comment
Open

Using old version of csvcubed with new $schema #884

SarahJohnsonONS opened this issue Sep 5, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@SarahJohnsonONS
Copy link
Contributor

SarahJohnsonONS commented Sep 5, 2023

When running an outdated version of csvcubed referencing a new version of the cube-config schema, the following error is raised:

2023-08-29 12:38:06,588 - csvcubed.cli.entrypoint - CRITICAL - Traceback (most recent call last):
  File "/Users/waf/.pyenv/versions/3.11.1/lib/python3.11/site-packages/csvcubed/cli/entrypoint.py", line 103, in build_command
    build_csvw(
  File "/Users/waf/.pyenv/versions/3.11.1/lib/python3.11/site-packages/csvcubed/cli/buildcsvw/build.py", line 32, in build_csvw
    cube, json_schema_validation_errors, validation_errors = _extract_and_validate_cube(
                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/waf/.pyenv/versions/3.11.1/lib/python3.11/site-packages/csvcubed/cli/buildcsvw/build.py", line 66, in _extract_and_validate_cube
    deserialiser = _get_versioned_deserialiser(config_path)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/waf/.pyenv/versions/3.11.1/lib/python3.11/site-packages/csvcubed/cli/buildcsvw/build.py", line 86, in _get_versioned_deserialiser
    return get_deserialiser_for_schema(config.get("$schema"))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/waf/.pyenv/versions/3.11.1/lib/python3.11/site-packages/csvcubed/readers/cubeconfig/schema_versions.py", line 88, in get_deserialiser_for_schema
    schema_version_major, schema_version_minor = _get_schema_version(schema_path)
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/waf/.pyenv/versions/3.11.1/lib/python3.11/site-packages/csvcubed/readers/cubeconfig/schema_versions.py", line 134, in _get_schema_version
    raise ValueError(
ValueError: The $schema 'https://purl.org/csv-cubed/qube-config/v1.5' referenced in the cube config file is not recognised. Please check for any updates to your csvcubed installation.
 (log.py:95)

Create a new error to catch this and verify if the user should update csvcubed or use a locally hosted version of the cube-config schema that is supported by the currently-installed version of csvcubed.

Update documentation with a new error entry on how to update csvcubed to use the correct version, when using a newer version of the cube config schema against an older version of csvcubed.

@SarahJohnsonONS SarahJohnsonONS changed the title Old version of schema Using old version of csvcubed with new $schema Sep 5, 2023
@SarahJohnsonONS SarahJohnsonONS added the bug Something isn't working label Sep 5, 2023
@canwaf
Copy link
Member

canwaf commented Sep 18, 2023

"The newest version of qube-config schema that should be able to be run by a given version of csvcubed cubed is the one that is distributed with csvcubed."

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
None yet
Development

No branches or pull requests

2 participants