@@ -239,10 +239,14 @@ Select single or multiple rows from a table, abstract vector or matrix
239
239
preferred sink type of `typeof(X)`, even if only a single row is
240
240
selected.
241
241
242
+ If the object is neither a table, abstract vector or matrix, `X` is
243
+ returned and `r` is ignored.
244
+
242
245
"""
243
246
selectrows (X, r) = selectrows (get_interface_mode (), vtrait (X), X, r)
244
247
245
- selectrows (:: Mode , :: Val{:other} , :: Nothing , r) = nothing
248
+ # fall-back is to return object, ignoring vector of row indices, `r`:
249
+ selectrows (:: Mode , :: Val{:other} , X:: Any , r) = X
246
250
247
251
selectrows (:: Mode , :: Val{:other} , X:: AbstractVector , r) = X[r]
248
252
selectrows (:: Mode , :: Val{:other} , X:: AbstractVector , r:: Integer ) = X[r: r]
@@ -252,10 +256,6 @@ selectrows(::Mode, ::Val{:other}, X::AbstractMatrix, r) = X[r, :]
252
256
selectrows (:: Mode , :: Val{:other} , X:: AbstractMatrix , r:: Integer ) = X[r: r, :]
253
257
selectrows (:: Mode , :: Val{:other} , X:: AbstractMatrix , :: Colon ) = X
254
258
255
- selectrows (:: Mode , :: Val{:other} , X, r) =
256
- throw (ArgumentError (" Function `selectrows` only supports AbstractVector " *
257
- " or AbstractMatrix or containers implementing the " * " Tables interface." ))
258
-
259
259
selectrows (:: LightInterface , :: Val{:table} , X, r; kw... ) =
260
260
errlight (" selectrows" )
261
261
0 commit comments