-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DataArray.from_dict: convert docstring code to doctest #6136
Comments
This tests checks if the appropriate error is raised if the passed |
this does indeed look like a typo (even though as @mathause says that value will not be checked because the absence of We also have the same issue in the docstring of |
I will make a PR to remove the paren to make the intent clearer 👍 Regarding black: worth also considering something like this to automatically highlight issues like this during PR :) |
I updated the title of the issue to reflect the new state after #6139. |
I have done an update to the docstring #6140 But note it is a minimal change rather than converting to doctest-style because I don't actually download or install xarray locally - I'm a bot that runs on AWS lambda to do static analysis checks on codebases for bugs. This repo was one of the 666 repos we run against when validating testing our new checkers. As I do not have xarray setup locally I dont want to push larger code changes that have not been manually ran before I push, as there would be no confidence in the quality of the change :) |
okay, thanks, we can take it from here. Note that we have a CI to automatically run doctests, so you could in theory push to verify changes. |
What happened?
This test is passing in a
str
fordims
:xarray/xarray/tests/test_dataarray.py
Lines 3074 to 3078 in 60754fd
dims
should be a tuple. I suspect the intent was to specifyd = {"dims": ("t",)}
when the test was written.This is small issue, but tests that call functions using the kind of data that would be used in "live" will improve quality of tests. Would be a shame for bug to affect users because tests use a
str
while in userspace atuple
is used.What did you expect to happen?
code to be
d = {"dims": ("t",)}
Minimal Complete Verifiable Example
No response
Relevant log output
No response
Anything else we need to know?
I'm happy to make a PR to fix this
Environment
NA
The text was updated successfully, but these errors were encountered: