Comments (7)
The problem is with Nullable
, and fixing it in NullableArrays would require type piracy. ==
with NullableArray is kinda forced to be inconsistent or not to work at all because ==
throws an errror for Nullable
in Base. The solution to this will be to move either to Union{T, Null}
(in DataFrames) or to DataValue{T}
.
from datatables.jl.
Yeah definitely. isqual
and ==
are separate functions in Base for a reason.
from datatables.jl.
I'm sure I can get a PR in for this in fairly short order.
from datatables.jl.
That would be fantastic. Thanks!
from datatables.jl.
Well, I figured out why DataTables.jl has just been using isequal
.
This is actually more complex to solve than I initially anticipated, owing to the fact that ==
checks between NullableArray
s are broken.
julia> using NullableArrays
julia> a = NullableArray(1:3)
3-element NullableArrays.NullableArray{Int64,1}:
1
2
3
julia> b = NullableArray(1:3)
3-element NullableArrays.NullableArray{Int64,1}:
1
2
3
julia> a == b
ERROR: TypeError: non-boolean (Nullable{Bool}) used in boolean context
Stacktrace:
[1] ==(::NullableArrays.NullableArray{Int64,1}, ::NullableArrays.NullableArray{Int64,1}) at ./abstractarray.jl:1527
This, in turn, is because ==
comparisons between Nullable
s return Nullable{Bool}
, rather than Bool
.
In my opinion, the best fix for this would be to provide ==
for NullableArrays
and work with that. There was a PR to fix this in 2015, but it was never merged: JuliaStats/NullableArrays.jl#84
I think I'm going to go ahead and take a shot at a PR here, but I suspect it isn't going to be pretty.
from datatables.jl.
I think the definition for ==
in DataValues.jl is ok at this point. I'm also in the process of adding a DataValueArray
that also fixes this, and then I'm also going to have a DataValueTable
that is based on that. Essentially that will be exactly the same design as the current DataTable
approach, except it will use DataValue
instead of Nullable
to get around the restrictions that we have due to Nullable
being in base and Nullable
not being special cased for the data science stack. I'm optimistic that I should be able to release soon, but on the flipside, classes start tomorrow, so who knows :)
from datatables.jl.
Makes sense to me. I've made changes to my code that's working with DataTables to work around this issue for the moment, and I won't spend time trying to make ==
work as expected (at least until Nullable
s behave themselves a little better). Thanks, folks!
from datatables.jl.
Related Issues (20)
- documentation link broken HOT 1
- Recommended date to make DataTables branches master HOT 4
- Overwrites DataFrames describe function HOT 11
- "correct" join results HOT 9
- usefulness of a `colwise!` method? HOT 5
- Strange error message at REPL with the latest Julia nightly HOT 5
- complete_cases for selected columns HOT 21
- How do I use CSV.read to return a DataTable instead of a DataFrame? HOT 3
- Make DataTables a major release of DataFrames HOT 3
- duplicate functionality in merge! and hcat! HOT 2
- Tag a new version? HOT 4
- Don't reexport Statsbase HOT 5
- describe does not function HOT 1
- Start replacing Nullable with Null HOT 3
- Throw error for type mismatch using join? HOT 5
- Join on columns of different name HOT 4
- Compiling error HOT 1
- Backporting to DataFrames HOT 7
- Future of DataTables HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datatables.jl.