Skip to content

BUG: xarray.backends.plugins.get_backend: fix passing in a backend directly - #5802

Closed
FRidh wants to merge 1 commit into
pydata:mainfrom
FRidh:get_backend
Closed

BUG: xarray.backends.plugins.get_backend: fix passing in a backend directly#5802
FRidh wants to merge 1 commit into
pydata:mainfrom
FRidh:get_backend

Conversation

@FRidh

Copy link
Copy Markdown

The open_dataset and open_mfdataset functions allow a user to pass
in a (custom) backend directly. This was however not functioning.

Selecting an engine with a string was functioning as expected, however,
passing in a backend class directly failed.

An instance of the backend is now created. A test has been added, as
well as some type hints.

  • Closes #xxxx
  • Tests added
  • Passes pre-commit run --all-files
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • New functions/methods are listed in api.rst

@pep8speaks

pep8speaks commented Sep 20, 2021

Copy link
Copy Markdown

Hello @FRidh! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-09-20 09:53:27 UTC

The `open_dataset` and `open_mfdataset` functions allow a user to pass
in a (custom) backend directly. This was however not functioning.
Selecting an engine with a string was functioning as expected, however,
passing in a backend class directly failed.
An instance of the backend is now created. A test has been added, as
well as some type hints.
@FRidh

Copy link
Copy Markdown
Author

readthedocs failure seems to be unrelated judging also from other PR's.

@github-actions

Copy link
Copy Markdown
Contributor

Unit Test Results

6 files 6 suites 55m 0s ⏱️
16 229 tests 14 493 ✔️ 1 735 💤 1 ❌
90 570 runs 82 390 ✔️ 8 174 💤 6 ❌

For more details on these failures, see this check.

Results for commit 628fbc8.

@FRidh

Copy link
Copy Markdown
Author

looks like there is a similar test in test_backends_api.py. Probably did something wrong myself so this is not needed.

@FRidhFRidh closed this Sep 20, 2021
@keewis

keewis commented Sep 20, 2021

Copy link
Copy Markdown
Collaborator

see #5684: you're not wrong in assuming that there's a bug in the backend code, but we have been a bit slow in merging the PR fixing it.

@Illviljan

Copy link
Copy Markdown
Contributor

The typing here is nice though if you want to continue with that.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@FRidh@pep8speaks@keewis@Illviljan