twosigma / twosigma/beakerx

How to display/format datetime in Table to be "human friendly" using the Python binding?

Open
#7,817 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
2.9k
Forks
383
PR merge metrics
No merged PRs in 30d

Description

I've been studying https://github.com/twosigma/beakerx/blob/master/doc/python/TableAPI.ipynb, specifically the lines

```Python
table.setStringFormatForTimes(TimeUnit.DAYS)
table.setStringFormatForType(ColumnType.Double, TableDisplayStringFormat.getDecimalFormat(4,6))
table.setStringFormatForColumn("m3", TableDisplayStringFormat.getDecimalFormat(0, 0))
```
but I can't figure out how to use (or write a custom formatter) to display datetimes in a "human friendly" way (e.g., something like [arrow's humanize](https://arrow.readthedocs.io/en/latest/#humanize)). I see a `humanFriendly` attribute in https://github.com/twosigma/beakerx/blob/1ecc9385dfe161ab8fe697dcc7996c1235cfa7a4/kernel/base/src/main/java/com/twosigma/beakerx/table/format/TimeStringFormat.java#L20-L22 and wonder whether I can access that attribute using Python (and if I could, whether it would provide something like what I'm looking for.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the formatting examples in doc/python/TableAPI.ipynb and the humanFriendly attribute in kernel/base/src/main/java/com/twosigma/beakerx/table/format/TimeStringFormat.java. Trace how time formats are exposed through the Python binding, then clarify whether the requested result requires exposing that attribute or supporting a custom formatter; done should provide a documented, usable Python path for human-friendly datetime display.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, jupyter-notebook, python
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.