Skip to content

Commit a5ca7c0

Browse files
authored
Merge pull request #37 from alan-turing-institute/nrows-of-nothing-is-zero
For a 0.2.2 release
2 parents 0997db8 + 2f4bdcd commit a5ca7c0

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name = "MLJModelInterface"
22
uuid = "e80e1ace-859a-464e-9ed9-23947d8ae3ea"
33
authors = ["Thibaut Lienart and Anthony Blaom"]
4-
version = "0.2.1"
4+
version = "0.2.2"
55

66
[deps]
77
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
88
ScientificTypes = "321657f4-b219-11e9-178b-2701a2544e81"
99

1010
[compat]
11-
ScientificTypes = "^0.7"
11+
ScientificTypes = "^0.7,^0.8"
1212
julia = "1"
1313

1414
[extras]

src/data_utils.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ Return the number of rows for a table, abstract vector or matrix `X` $REQUIRE.
191191
nrows(X) = nrows(get_interface_mode(), vtrait(X), X)
192192

193193
nrows(::Mode, ::Val{:other}, X::AbstractVecOrMat) = size(X, 1)
194+
nrows(::Mode, ::Val{:other}, X::Nothing) = 0
194195

195196
nrows(::Mode, ::Val{:other}, X) =
196197
throw(ArgumentError("Function `nrows` only supports AbstractVector or " *

test/data_utils.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ end
9797
@test_throws ArgumentError nrows(X)
9898
X = (a=[4,2,1],b=[3,2,1])
9999
@test_throws M.InterfaceError nrows(X)
100+
@test nrows(nothing) == 0
100101
end
101102
@testset "nrows-full" begin
102103
setfull()

0 commit comments

Comments
 (0)