Repository: JuliaData/Tables.jl
Pull request #350 (2023-10-20 23:17:04)

fix error in error
tiny fix since `ret` isn't defined. (found by JET!)

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/JuliaData/Tables.jl/pull/350?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaData) Report
Attention: `1 lines` in your changes are missing coverage. Please review.
> Comparison is base [(`1f79db0`)](https://app.codecov.io/gh/JuliaData/Tables.jl/commit/1f79db0c6a279611484ad09751f1f581b78d398e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaData) 94.58% compared to head [(`1bb4412`)](https://app.codecov.io/gh/JuliaData/Tables.jl/pull/350?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaData) 94.15%.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main     #350      +/-   ##
==========================================
- Coverage   94.58%   94.15%   -0.43%     
==========================================
  Files           7        7              
  Lines         739      736       -3     
==========================================
- Hits          699      693       -6     
- Misses         40       43       +3     
```


| [Files](https://app.codecov.io/gh/JuliaData/Tables.jl/pull/350?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaData) | Coverage Δ | |
|---|---|---|
| [src/dicts.jl](https://app.codecov.io/gh/JuliaData/Tables.jl/pull/350?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaData#diff-c3JjL2RpY3RzLmps) | `94.06% <50.00%> (ø)` | |

... and [4 files with indirect coverage changes](https://app.codecov.io/gh/JuliaData/Tables.jl/pull/350/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaData)


</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/JuliaData/Tables.jl/pull/350?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaData).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaData).


Patch:
diff --git a/src/dicts.jl b/src/dicts.jl
index addc2fd..e390d20 100644
--- a/src/dicts.jl
+++ b/src/dicts.jl
@@ -126,14 +126,14 @@ end
 
 function subset(x::DictRowTable, inds; viewhint::Union{Bool,Nothing}=nothing, view::Union{Bool,Nothing}=nothing)
     if view !== nothing
-        @warn "`view` keyword argument is deprecated for `Tables.subset`, use `viewhint` instead"
+        @warn "`view` keyword argument is deprecated for `Tables.subset`, use `viewhint` instead" maxlog=10
         viewhint = view
     end
     values = viewhint === true ? Base.view(getfield(x, :values), inds) : getfield(x, :values)[inds]
     if inds isa Integer
         return DictRow(getfield(x, :names), values)
     else
-        values isa AbstractVector || throw(ArgumentError("`Tables.subset`: invalid `inds` argument, expected `RowTable` output, got $(typeof(ret))"))
+        values isa AbstractVector || throw(ArgumentError("`Tables.subset`: invalid `inds` argument, expected `RowTable` output, got $(typeof(values))"))
         return DictRowTable(getfield(x, :names), getfield(x, :types), values)
     end
 end


Test patch:
diff --git a/test/runtests.jl b/test/runtests.jl
index 2e2aab8..832dc80 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -153,6 +153,7 @@ end
         @test Tables.subset(nt, 1:2, viewhint=false) == (a=[1,2], b=[4.0, 5.0], c=["7","8"])
         @test Tables.subset(nt, 1:2, viewhint=nothing) == (a=[1,2], b=[4.0, 5.0], c=["7","8"])
         @test_throws ArgumentError Tables.subset(nt, [1:2 1:2])
+        @test_throws ArgumentError Tables.subset(Tables.dictrowtable(nt), [1:2 1:2])
 
         @test Tables.subset(nt, 1, viewhint=true) == (a=1, b=4.0, c="7")
         rs = Tables.subset(nt, 1:2, viewhint=true)
@@ -1038,4 +1039,4 @@ end
     @test DataAPI.ncol(Tables.dictrowtable(NamedTuple[])) == 0
     @test DataAPI.nrow(Tables.dictrowtable([(a=1, b=2), (a=3, b=4), (a=5, b=6)])) == 3
     @test DataAPI.ncol(Tables.dictrowtable([(a=1, b=2), (a=3, b=4), (a=5, b=6)])) == 2
-end
\ No newline at end of file
+end