@@ -239,10 +239,14 @@ Select single or multiple rows from a table, abstract vector or matrix
239239preferred sink type of `typeof(X)`, even if only a single row is
240240selected.
241241
242+ If the object is neither a table, abstract vector or matrix, `X` is
243+ returned and `r` is ignored.
244+
242245"""
243246selectrows (X, r) = selectrows (get_interface_mode (), vtrait (X), X, r)
244247
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
246250
247251selectrows (:: Mode , :: Val{:other} , X:: AbstractVector , r) = X[r]
248252selectrows (:: Mode , :: Val{:other} , X:: AbstractVector , r:: Integer ) = X[r: r]
@@ -252,10 +256,6 @@ selectrows(::Mode, ::Val{:other}, X::AbstractMatrix, r) = X[r, :]
252256selectrows (:: Mode , :: Val{:other} , X:: AbstractMatrix , r:: Integer ) = X[r: r, :]
253257selectrows (:: Mode , :: Val{:other} , X:: AbstractMatrix , :: Colon ) = X
254258
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-
259259selectrows (:: LightInterface , :: Val{:table} , X, r; kw... ) =
260260 errlight (" selectrows" )
261261
0 commit comments