Skip to content

Commit a225f79

Browse files
committed
bug fix
1 parent 3bc09f4 commit a225f79

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/charts/bar.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,16 @@ function _check_and_normalize!(plt::Bar, all_args)
318318
end
319319

320320

321-
if opts[:missingmode] in (1, 3)
322-
cp_ds = dropmissing(ds, col, threads = false, mapformats=all_args.mapformats, view=true)
323-
elseif opts[:missingmode] in (2, 3) && opts[:group] !== nothing
324-
cp_ds = dropmissing(ds, opts[:group], threads = false, mapformats=all_args.mapformats, view=true)
321+
if opts[:missingmode] == 1
322+
cp_ds = dropmissing(ds, col, threads = threads, mapformats=all_args.mapformats, view=true)
323+
elseif opts[:missingmode] == 2 && opts[:group] !== nothing
324+
cp_ds = dropmissing(ds, opts[:group], threads = threads, mapformats=all_args.mapformats, view=true)
325+
elseif opts[:missingmode] == 3
326+
_cols = unique([col, something(opts[:group], col) ])
327+
cp_ds = dropmissing(ds, _cols, threads = threads, mapformats=all_args.mapformats, view=true)
325328
elseif opts[:missingmode] == 4
326329
_cols = unique([col, something(opts[:group], col) ])
327-
cp_ds = dropmissing(ds, _cols, threads = false, mapformats=all_args.mapformats, view=true)
330+
cp_ds = delete(ds, _cols, by = ismissing, threads = threads, mapformats=all_args.mapformats, view=true)
328331
else
329332
cp_ds = ds
330333
end

src/charts/pie.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,16 @@ function _check_and_normalize!(plt::Pie, all_args)
240240
end
241241

242242
# we should handle missings here before passing ds for further analysis
243-
if opts[:missingmode] in (1, 3)
243+
if opts[:missingmode] == 1
244244
cp_ds = dropmissing(ds, col, threads = threads, mapformats=all_args.mapformats, view=true)
245-
elseif opts[:missingmode] in (2, 3) && opts[:group] !== nothing
245+
elseif opts[:missingmode] == 2 && opts[:group] !== nothing
246246
cp_ds = dropmissing(ds, opts[:group], threads = threads, mapformats=all_args.mapformats, view=true)
247-
elseif opts[:missingmode] == 4
247+
elseif opts[:missingmode] == 3
248248
_cols = unique([col, something(opts[:group], col) ])
249249
cp_ds = dropmissing(ds, _cols, threads = threads, mapformats=all_args.mapformats, view=true)
250+
elseif opts[:missingmode] == 4
251+
_cols = unique([col, something(opts[:group], col) ])
252+
cp_ds = delete(ds, _cols, by = ismissing, threads = threads, mapformats=all_args.mapformats, view=true)
250253
else
251254
cp_ds = ds
252255
end

0 commit comments

Comments
 (0)