Skip to content

Commit eca7adb

Browse files
author
Christopher Doris
committed
test(numpydates): fixes for julia 1.9
1 parent 60de18b commit eca7adb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/NumpyDates/AbstractTimeDelta64.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ abstract type AbstractTimeDelta64 <: Dates.Period end
77

88
function construct(::Type{T}, d::AbstractTimeDelta64) where {T<:DatesPeriod}
99
v, r = rescale(value(d), unitpair(d), Unit(T))
10-
iszero(r) || throw(InexactError(nameof(T), T, d))
10+
iszero(r) || throw(InexactError(:convert, T, d))
1111
T(v)
1212
end
1313

src/NumpyDates/TimeDelta64.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function TimeDelta64(d::AbstractTimeDelta64, unit::UnitArg = defaultunit(d))
3939
TimeDelta64(NAT, unit)
4040
else
4141
v, r = rescale(value(d), unitpair(d), unit)
42-
iszero(r) || throw(InexactError(:TimeDelta64, TimeDelta64, d, unit))
42+
iszero(r) || throw(InexactError(:convert, TimeDelta64, d))
4343
TimeDelta64(v, unit)
4444
end
4545
end
@@ -57,7 +57,7 @@ end
5757

5858
function TimeDelta64(p::DatesPeriod, unit::UnitArg = defaultunit(p))
5959
v, r = rescale(value(p), Unit(p), unit)
60-
iszero(r) || throw(InexactError(:TimeDelta64, TimeDelta64, p, unit))
60+
iszero(r) || throw(InexactError(:convert, TimeDelta64, p))
6161
TimeDelta64(v, unit)
6262
end
6363

test/NumpyDates.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ end
631631

632632
inexact_cases = [(Millisecond(3001), :s), (Day(-1), :W)]
633633

634-
@testset "$p $usym" for (p, usym) in inexact_cases
634+
@testset "$p => $usym" for (p, usym) in inexact_cases
635635
@test_throws InexactError NumpyDates.TimeDelta64(p, usym)
636636
@test_throws InexactError NumpyDates.InlineTimeDelta64(p, usym)
637637
Uconst = NumpyDates.Unit(usym)

0 commit comments

Comments
 (0)