[MDBF-80] Display result set in pandas DataFrame for better formatting Created: 2020-05-25  Updated: 2022-02-01  Due: 2020-06-08

Status: Closed
Project: MariaDB Foundation Development
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: Kaj Arnö Assignee: Robert Bindar
Resolution: Unresolved Votes: 0
Labels: jupyter
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File maria_table.png    
Issue Links:
PartOf
is part of MDBF-55 Development of Jupyter maria kernel, ... Closed

 Description   
  • display result set in pandas DataFrame (better formatting, like a table, not with ---)
  • use a wrapper around how Jupyter normally displays dataframes


 Comments   
Comment by Vicențiu Ciorbaru [ 2020-06-01 ]

This and MDBF-79 can be solved by intercepting the output, processing the results and only then displaying it via a built-in jupyter table.

Comment by Kaj Arnö [ 2020-06-03 ]

Isn't it architecturally cheaper to intercept the input (the SELECT statement) by wrapping a DataFrame around it?

Comment by Robert Bindar [ 2020-09-09 ]

For this and MDBF-79, the most elegant solution I could find is to use the mariadb> cmd client to get the output in the HTML form. This feature of the mariadb> client makes our job extremely easier, output of SELECTs in the HTML format can simply be wrapped into a nice Jupyter protocol message and then Jupyter Lab displays automagically the data into nice scrollable tables exactly like for Python DataFrames.
As far as I can see this trick also avoids all the problems with parsing the data coming from mariadb> cmd client.
See the attached image as an example.

Generated at Thu Feb 08 03:35:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.