Repository navigation
Commit 030c929
authored
Adapt test_dataset_math_errors for coming NumPy changes (#11435)
This PR adapts `test_dataset_math_errors` for coming updates in NumPy. We can no longer rely on arithmetic between `datetime64` values and plain integers working without a warning or error.
My understanding of this test is that we want adding a `datetime64` value to `"bar"` to succeed so that we can check that the failure in adding a `datetime64` value to `"foo"` prevents updating any variable in the Dataset. Therefore we explicitly cast `"bar"` to an array of `"timedelta64[ns]"` values so that this continues to be the case moving forward.
Even though it is not strictly necessary, we also provide units in the `datetime64` constructor when creating `other`.
Addresses one part of #11402.1 parent b8141f6 commit 030c929
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6753 | 6753 | | |
6754 | 6754 | | |
6755 | 6755 | | |
6756 | | - | |
6757 | | - | |
6758 | | - | |
| 6756 | + | |
| 6757 | + | |
| 6758 | + | |
6759 | 6759 | | |
| 6760 | + | |
6760 | 6761 | | |
6761 | 6762 | | |
6762 | 6763 | | |
| |||
0 commit comments