Skip to content

Commit b4833c6

Browse files
author
Pietro Vertechi
authored
Merge pull request #263 from JuliaComputing/pv/between
Take special selectors from DataAPI
2 parents 8b135b3 + 9ac5ad3 commit b4833c6

File tree

3 files changed

+5
-33
lines changed

3 files changed

+5
-33
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ uuid = "6deec6e2-d858-57c5-ab9b-e6ca5bd20e43"
33
version = "0.12.2"
44

55
[deps]
6+
DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
67
DataValues = "e7dc6d0d-1eca-5fa6-8ad6-5aecde8b7ea5"
78
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
89
IteratorInterfaceExtensions = "82899510-4779-5014-852e-03e436cf321d"
@@ -17,6 +18,7 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1718
WeakRefStrings = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"
1819

1920
[compat]
21+
DataAPI = "1.0.1"
2022
DataValues = "0.4.6"
2123
IteratorInterfaceExtensions = "0.1.1, 1"
2224
OnlineStatsBase = "0.9.1, 0.10, 0.11, 0.12, 0.13"

src/IndexedTables.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import Tables, TableTraits, IteratorInterfaceExtensions, TableTraitsUtils
1313

1414
import DataValues: DataValue, DataValueArray, isna
1515

16+
import DataAPI: Between, All
17+
1618
import Base:
1719
show, eltype, length, getindex, setindex!, ndims, map, convert, keys, values,
1820
==, broadcast, empty!, copy, similar, sum, merge, merge!, mapslices,

src/columns.jl

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -140,23 +140,6 @@ map_rows(f, iter) = collect_columns(f(i) for i in iter)
140140

141141
## Special selectors to simplify column selector
142142

143-
"""
144-
All(cols::Union{Symbol, Int}...)
145-
146-
Select the union of the selections in `cols`. If `cols == ()`, select all columns.
147-
148-
# Examples
149-
150-
t = table([1,1,2,2], [1,2,1,2], [1,2,3,4], [0, 0, 0, 0], names=[:a,:b,:c,:d])
151-
select(t, All(:a, (:b, :c)))
152-
select(t, All())
153-
"""
154-
struct All{T}
155-
cols::T
156-
end
157-
158-
All(args...) = All(args)
159-
160143
"""
161144
Not(cols::Union{Symbol, Int}...)
162145
@@ -173,7 +156,7 @@ struct Not{T}
173156
cols::T
174157
end
175158

176-
Not(args...) = Not(All(args))
159+
@deprecate Not(args...) Not(All(args...))
177160

178161
"""
179162
Keys()
@@ -187,21 +170,6 @@ Select the primary keys.
187170
"""
188171
struct Keys; end
189172

190-
"""
191-
Between(first, last)
192-
193-
Select the columns between `first` and `last`.
194-
195-
# Examples
196-
197-
t = table([1,1,2,2], [1,2,1,2], 1:4, 'a':'d', names=[:a,:b,:c,:d])
198-
select(t, Between(:b, :d))
199-
"""
200-
struct Between{T1 <: Union{Int, Symbol}, T2 <: Union{Int, Symbol}}
201-
first::T1
202-
last::T2
203-
end
204-
205173
const SpecialSelector = Union{Not, All, Keys, Between, Function, Regex, Type}
206174

207175
hascolumns(t, s) = true

0 commit comments

Comments
 (0)