Skip to content

Commit 85632b2

Browse files
committed
suppress print when output = true in content
1 parent 0404c64 commit 85632b2

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/abstractdataset/abstractdataset.jl

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -293,27 +293,30 @@ end
293293
prints the meta information about `ds` and its columns. Setting `output = true` return a vector of data sets which contains the printed information as data sets.
294294
"""
295295
function content(ds::AbstractDataset; output = false)
296-
println(summary(ds))
297-
if typeof(ds) <: SubDataset
298-
println("-----------------------------------")
299-
println("The parent's Meta information")
296+
if !output
297+
println(summary(ds))
298+
if typeof(ds) <: SubDataset
299+
println("-----------------------------------")
300+
println("The parent's Meta information")
301+
end
302+
println(" Created: ", _attributes(ds).meta.created)
303+
println(" Modified: ", _attributes(ds).meta.modified[])
304+
println(" Info: ", _attributes(ds).meta.info[])
300305
end
301-
println(" Created: ", _attributes(ds).meta.created)
302-
println(" Modified: ", _attributes(ds).meta.modified[])
303-
println(" Info: ", _attributes(ds).meta.info[])
304306
f_v = [String[], Function[], Type[]]
305307
all_names = names(ds)
306308
for i in 1:ncol(ds)
307309
push!(f_v[1], all_names[i])
308310
push!(f_v[2], getformat(ds, i))
309311
push!(f_v[3], nonmissingtype(eltype(ds[!, i])))
310312
end
311-
312313
format_ds = Dataset(f_v, [:column, :format, :eltype], copycols = false)
313-
println("-----------------------------------")
314-
println("Columns information ")
315-
pretty_table(format_ds, header = (["col", "format", "eltype"]), alignment =:l, show_row_number = true)
316-
if output
314+
if !output
315+
println("-----------------------------------")
316+
println("Columns information ")
317+
pretty_table(format_ds, header = (["col", "format", "eltype"]), alignment =:l, show_row_number = true)
318+
319+
else
317320
[Dataset(meta = ["created", "modified", "info"], value = [_attributes(ds).meta.created, _attributes(ds).meta.modified[], _attributes(ds).meta.info[]]), format_ds]
318321
end
319322
end

0 commit comments

Comments
 (0)