thisisnic commented on PR #41425:
URL: https://github.com/apache/arrow/pull/41425#issuecomment-2094818879
This has turned about to be hairier than it looks and I may have to abandon
this PR as I don't have time to finish it. I'll leave more information here
though in case anyone else wants to pick it up or I come back to it at some
point.
The issues I had lay in the fact that initially I thought we'd need to
define a ton of S3 methods for different functions which needed subtly changing
from the ones which run on a tibble. I tried, on another branch to implement
the minimal set of changes, and just edit the displayed table which was created
for a tibble, but this led to more problems as the types didn't line up with
the column widths and we'd either have to truncate them or dive into the
calculation of the column widths which is where I don't have time to go deeper.
To illustrate, here's the `dplyr::starwars` data with Arrow types but the
types not aligned with the column names:
```
> arrow_table(dplyr::starwars)
# An Arrow Table: 87 x 14
name height mass hair_color skin_color eye_color birth_year sex
gender homeworld species films
<string><int32><double><string><string><string><double><string><string><string><string><list<...>><list<...>><list<...>>
1 Luke … 172 77 blond fair blue 19 male
mascu… Tatooine Human [5]
2 C-3PO 167 75 NA gold yellow 112 none
mascu… Tatooine Droid [6]
3 R2-D2 96 32 NA white, bl… red 33 none
mascu… Naboo Droid [7]
4 Darth… 202 136 none white yellow 41.9 male
mascu… Tatooine Human [4]
5 Leia … 150 49 brown light brown 19 fema…
femin… Alderaan Human [5]
6 Owen … 178 120 brown, gr… light blue 52 male
mascu… Tatooine Human [3]
7 Beru … 165 75 brown light blue 47 fema…
femin… Tatooine Human [3]
8 R5-D4 97 32 NA white, red red NA none
mascu… Tatooine Droid [1]
9 Biggs… 183 84 black light brown 24 male
mascu… Tatooine Human [1]
10 Obi-W… 182 77 auburn, w… fair blue-gray 57 male
mascu… Stewjon Human [6]
# ℹ 77 more rows
# ℹ 2 more variables: vehicles <list<character>>, starships <list<character>>
# ℹ Use `print(n = ...)` to see more rows
```
Here's the branch containing the simpler implementation that's a bit nicer
than where I got to with this one:
https://github.com/apache/arrow/compare/main...thisisnic:arrow:print2
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]