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

TypeError: _validate_attrs() missing 1 required positional argument: 'engine' #400

Closed
jhamman opened this issue Sep 5, 2024 · 2 comments · Fixed by #401
Closed

TypeError: _validate_attrs() missing 1 required positional argument: 'engine' #400

jhamman opened this issue Sep 5, 2024 · 2 comments · Fixed by #401
Labels
bug Something isn't working

Comments

@jhamman
Copy link

jhamman commented Sep 5, 2024

What happened?

An upstream change to xarray's validate_attrs function has broken canonical_dataset_to_grib. This change has not been released yet but will in the coming days.

See pydata/xarray#9407 for more details.

What are the steps to reproduce the bug?

The traceback is below:

    def canonical_dataset_to_grib(dataset, path, mode="wb", no_warn=False, grib_keys={}, **kwargs):
        # type: (xr.Dataset, str, str, bool, T.Dict[str, T.Any], T.Any) -> None
        """
        Write a ``xr.Dataset`` in *canonical* form to a GRIB file.
        """
        if not no_warn:
            warnings.warn("GRIB write support is experimental, DO NOT RELY ON IT!", FutureWarning)
    
        # validate Dataset keys, DataArray names, and attr keys/values
        xr.backends.api._validate_dataset_names(dataset)  # type: ignore
>       xr.backends.api._validate_attrs(dataset)  # type: ignore
E       TypeError: _validate_attrs() missing 1 required positional argument: 'engine'

Version

0.9.14.0

Platform (OS and architecture)

linux

Relevant log output

No response

Accompanying data

No response

Organisation

No response

@jhamman jhamman added the bug Something isn't working label Sep 5, 2024
@iainrussell
Copy link
Member

Thank you @jhamman - that was a useful link, and sped up the fix! I'm just releasing 0.9.14.1 now with this fix.

@jhamman
Copy link
Author

jhamman commented Sep 12, 2024

Thanks @iainrussell!

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

Successfully merging a pull request may close this issue.

2 participants