thisisnic opened a new pull request, #38917:
URL: https://github.com/apache/arrow/pull/38917

   ### Rationale for this change
   
   When printing objects with data with lots of rows, the output is long and 
unwieldy.
   
   ### What changes are included in this PR?
   
   Truncates long schema print output and adds the number of columns to dataset 
print output.
   
   ### Are these changes tested?
   
   Yes
   
   ### Are there any user-facing changes?
   
   Yes
   
   Before:
   
   ``` r
   library(arrow)
   x <- tibble::tibble(!!!letters, .rows = 5)
   InMemoryDataset$create(x)
   #> InMemoryDataset
   #> "a": string
   #> "b": string
   #> "c": string
   #> "d": string
   #> "e": string
   #> "f": string
   #> "g": string
   #> "h": string
   #> "i": string
   #> "j": string
   #> "k": string
   #> "l": string
   #> "m": string
   #> "n": string
   #> "o": string
   #> "p": string
   #> "q": string
   #> "r": string
   #> "s": string
   #> "t": string
   #> "u": string
   #> "v": string
   #> "w": string
   #> "x": string
   #> "y": string
   #> "z": string
   arrow_table(x)
   #> Table
   #> 5 rows x 26 columns
   #> $"a" <string>
   #> $"b" <string>
   #> $"c" <string>
   #> $"d" <string>
   #> $"e" <string>
   #> $"f" <string>
   #> $"g" <string>
   #> $"h" <string>
   #> $"i" <string>
   #> $"j" <string>
   #> $"k" <string>
   #> $"l" <string>
   #> $"m" <string>
   #> $"n" <string>
   #> $"o" <string>
   #> $"p" <string>
   #> $"q" <string>
   #> $"r" <string>
   #> $"s" <string>
   #> $"t" <string>
   #> $"u" <string>
   #> $"v" <string>
   #> $"w" <string>
   #> $"x" <string>
   #> $"y" <string>
   #> $"z" <string>
   record_batch(x)
   #> RecordBatch
   #> 5 rows x 26 columns
   #> $"a" <string>
   #> $"b" <string>
   #> $"c" <string>
   #> $"d" <string>
   #> $"e" <string>
   #> $"f" <string>
   #> $"g" <string>
   #> $"h" <string>
   #> $"i" <string>
   #> $"j" <string>
   #> $"k" <string>
   #> $"l" <string>
   #> $"m" <string>
   #> $"n" <string>
   #> $"o" <string>
   #> $"p" <string>
   #> $"q" <string>
   #> $"r" <string>
   #> $"s" <string>
   #> $"t" <string>
   #> $"u" <string>
   #> $"v" <string>
   #> $"w" <string>
   #> $"x" <string>
   #> $"y" <string>
   #> $"z" <string>
   ```
   
   After:
   
   ``` r
   library(arrow)
   
   x <- tibble::tibble(!!!letters, .rows = 5)
   InMemoryDataset$create(x)
   #> InMemoryDataset
   #> 26 columns 
   #> "a": string
   #> "b": string
   #> "c": string
   #> "d": string
   #> "e": string
   #> "f": string
   #> "g": string
   #> "h": string
   #> "i": string
   #> "j": string
   #> "k": string
   #> "l": string
   #> "m": string
   #> "n": string
   #> "o": string
   #> "p": string
   #> "q": string
   #> "r": string
   #> "s": string
   #> "t": string
   #> ...
   #> Use `schema()` to see entire schema
   arrow_table(x)
   #> Table
   #> 5 rows x 26 columns
   #> $"a" <string>
   #> $"b" <string>
   #> $"c" <string>
   #> $"d" <string>
   #> $"e" <string>
   #> $"f" <string>
   #> $"g" <string>
   #> $"h" <string>
   #> $"i" <string>
   #> $"j" <string>
   #> $"k" <string>
   #> $"l" <string>
   #> $"m" <string>
   #> $"n" <string>
   #> $"o" <string>
   #> $"p" <string>
   #> $"q" <string>
   #> $"r" <string>
   #> $"s" <string>
   #> $"t" <string>
   #> ...
   #> Use `schema()` to see entire schema
   record_batch(x)
   #> RecordBatch
   #> 5 rows x 26 columns
   #> $"a" <string>
   #> $"b" <string>
   #> $"c" <string>
   #> $"d" <string>
   #> $"e" <string>
   #> $"f" <string>
   #> $"g" <string>
   #> $"h" <string>
   #> $"i" <string>
   #> $"j" <string>
   #> $"k" <string>
   #> $"l" <string>
   #> $"m" <string>
   #> $"n" <string>
   #> $"o" <string>
   #> $"p" <string>
   #> $"q" <string>
   #> $"r" <string>
   #> $"s" <string>
   #> $"t" <string>
   #> ...
   #> Use `schema()` to see entire schema
   ```
   


-- 
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]

Reply via email to