Skip to content

Commit 0ecb038

Browse files
author
Christopher Doris
committed
refactor(numpydates): add concrete type check for inline datetime/timedelta types
Ensure that type T is concrete before checking if it subtypes the union of InlineDateTime64 and InlineTimeDelta64, preventing potential issues with abstract types in pytypestrdescr function.
1 parent c8c411a commit 0ecb038

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/JlWrap/array.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ pytypestrdescr(::Type{T}) where {T} =
267267
("$(c)c8", PyNULL)
268268
elseif T == Complex{Float64}
269269
("$(c)c16", PyNULL)
270-
elseif T <: Union{NumpyDates.InlineDateTime64,NumpyDates.InlineTimeDelta64}
270+
elseif isconcretetype(T) &&
271+
T <: Union{NumpyDates.InlineDateTime64,NumpyDates.InlineTimeDelta64}
271272
u, m = NumpyDates.unitpair(T)
272273
tc = T <: NumpyDates.InlineDateTime64 ? 'M' : 'm'
273274
us =

0 commit comments

Comments
 (0)