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

Can not open glade-cesm2-le.json #100

Open
mnlevy1981 opened this issue Feb 16, 2024 · 1 comment
Open

Can not open glade-cesm2-le.json #100

mnlevy1981 opened this issue Feb 16, 2024 · 1 comment

Comments

@mnlevy1981
Copy link
Contributor

I think this is an issue with the catalog itself, rather than an intake-esm problem? @sgyeager reported this in Zulip, and I've verified that I am running into the same error both on Casper and my local laptop.

  1. Create clean environment (mamba create -n test-intake intake-esm)
  2. Clone https://github.com/NCAR/intake-esm-datastore (git clone https://github.com/NCAR/intake-esm-datastore.git)
  3. cd intake-esm-datastore
  4. activate my new environment and load python
Python 3.12.1 | packaged by conda-forge | (main, Dec 23 2023, 08:01:35) [Clang 16.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import intake
>>> import intake_esm
>>> intake_esm.show_versions()

INSTALLED VERSIONS
------------------

cftime: 1.6.3
dask: 2024.2.0
fastprogress: 1.0.3
fsspec: 2024.2.0
gcsfs: None
intake: 0.7.0
intake_esm: 2024.2.6
netCDF4: 1.6.5
pandas: 2.2.0
requests: 2.31.0
s3fs: None
xarray: 2024.1.1
zarr: 2.17.0
>>> col = intake.open_esm_datastore('catalogs/glade-cesm2-le.json')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mlevy/miniconda3/envs/test-intake/lib/python3.12/site-packages/intake_esm/core.py", line 107, in __init__
    self.esmcat = ESMCatalogModel.load(
                  ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mlevy/miniconda3/envs/test-intake/lib/python3.12/site-packages/intake_esm/cat.py", line 242, in load
    cat = cls.model_validate(data)
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mlevy/miniconda3/envs/test-intake/lib/python3.12/site-packages/pydantic/main.py", line 509, in model_validate
    return cls.__pydantic_validator__.validate_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for ESMCatalogModel
aggregation_control.aggregations.0.options
  Input should be a valid dictionary [type=dict_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.6/v/dict_type
@mgrover1
Copy link
Collaborator

Thanks for the heads up @mnlevy1981 Yeah - it appears the new version of pydantic breaks that class... we will need to pin to an older version and update its usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants