Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output from ds/rows doesn't pprint well (all on one line) #335

Open
harold opened this issue Nov 21, 2022 · 0 comments
Open

output from ds/rows doesn't pprint well (all on one line) #335

harold opened this issue Nov 21, 2022 · 0 comments

Comments

@harold
Copy link
Contributor

harold commented Nov 21, 2022

Repl'ing some datasets and having a lot of fun, but came across a case that didn't print well related to ds/rows:

> (def m {:aaaaaaaaaaa 1 :bbbbbbbbbbb 2 :ccccccccccc 3 :ddddddddddd 4 :eeeeeeeeeee 5})
#'m
> (clojure.pprint/pprint m)
{:aaaaaaaaaaa 1,
 :bbbbbbbbbbb 2,
 :ccccccccccc 3,
 :ddddddddddd 4,
 :eeeeeeeeeee 5}
nil
> (def ds (ds/->dataset [m m m m m]))
#'ds
> ds
_unnamed [5 5]:

| :ccccccccccc | :ddddddddddd | :aaaaaaaaaaa | :eeeeeeeeeee | :bbbbbbbbbbb |
|-------------:|-------------:|-------------:|-------------:|-------------:|
|            3 |            4 |            1 |            5 |            2 |
|            3 |            4 |            1 |            5 |            2 |
|            3 |            4 |            1 |            5 |            2 |
|            3 |            4 |            1 |            5 |            2 |
|            3 |            4 |            1 |            5 |            2 |
> (clojure.pprint/pprint (ds/rows ds))
[{:ccccccccccc 3, :ddddddddddd 4, :aaaaaaaaaaa 1, :eeeeeeeeeee 5, :bbbbbbbbbbb 2} {:ccccccccccc 3, :ddddddddddd 4, :aaaaaaaaaaa 1, :eeeeeeeeeee 5, :bbbbbbbbbbb 2} {:ccccccccccc 3, :ddddddddddd 4, :aaaaaaaaaaa 1, :eeeeeeeeeee 5, :bbbbbbbbbbb 2} {:ccccccccccc 3, :ddddddddddd 4, :aaaaaaaaaaa 1, :eeeeeeeeeee 5, :bbbbbbbbbbb 2} {:ccccccccccc 3, :ddddddddddd 4, :aaaaaaaaaaa 1, :eeeeeeeeeee 5, :bbbbbbbbbbb 2}]
nil
> (clojure.pprint/pprint [m m m m m])
[{:aaaaaaaaaaa 1,
  :bbbbbbbbbbb 2,
  :ccccccccccc 3,
  :ddddddddddd 4,
  :eeeeeeeeeee 5}
 {:aaaaaaaaaaa 1,
  :bbbbbbbbbbb 2,
  :ccccccccccc 3,
  :ddddddddddd 4,
  :eeeeeeeeeee 5}
 {:aaaaaaaaaaa 1,
  :bbbbbbbbbbb 2,
  :ccccccccccc 3,
  :ddddddddddd 4,
  :eeeeeeeeeee 5}
 {:aaaaaaaaaaa 1,
  :bbbbbbbbbbb 2,
  :ccccccccccc 3,
  :ddddddddddd 4,
  :eeeeeeeeeee 5}
 {:aaaaaaaaaaa 1,
  :bbbbbbbbbbb 2,
  :ccccccccccc 3,
  :ddddddddddd 4,
  :eeeeeeeeeee 5}]
nil
> (= (ds/rows ds) [m m m m m])
true

Somehow the reader of FastStructs (or whatever ds/rows returns) is pprinting the maps all on one line.

@harold harold changed the title output from ds/rows doesn't pprint well output from ds/rows doesn't pprint well (all on one line) Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant