styling: a float column holding an infinity falls back to the obj displayer (OverflowError in _formatted_char_count)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- data-visualization
Research direction
Start in customizations/styling.py at _formatted_char_count, then trace how its result is used by DefaultMainStyling.style_column and the summary-stats styling. Reproduce with the provided infinity example; done means non-finite bounds no longer raise OverflowError and the float column keeps its float displayer instead of falling back.
Written by the indexing model from the issue text.
Description
Problem
_formatted_char_count (customizations/styling.py:25) sizes a float column from int(max(abs(max), abs(min))). It guards NaN (max_abs == max_abs) but not infinity, so a column whose min or max is inf or -inf raises OverflowError: cannot convert float infinity to integer. DefaultMainStyling.style_column calls it through estimate_min_width_px (line 130), style_column_with_fallback (dataflow/styling_core.py:560) logs the warning and falls back, and the column is shown with the obj displayer and no minWidth. The summary-stats view (DefaultSummaryStatsStyling) falls back the same way. Pandas and polars widgets both do this, and so does the DDD frame df_with_infinity.
import numpy as np
import pandas as pd
from buckaroo.buckaroo_widget import BuckarooWidget
df = pd.DataFrame({"with_inf": [1.5, 2.5, np.inf, 4.5], "no_inf": [1.5, 2.5, 3.5, 4.5]})
for cc in BuckarooWidget(df).df_display_args["main"]["df_viewer_config"]["column_config"]:
print(cc["header_name"], cc["displayer_args"])
# with_inf {'displayer': 'obj'}
# no_inf {'displayer': 'float', 'min_fraction_digits': 3, 'max_fraction_digits': 3}
Suggested fix
Size from the finite bounds: skip a non-finite min or max the way NaN is skipped.
Context
Found while testing the infinity histograms in #1069. Reproduces on main at 315286fd.
- Dominant language
- Python
- Stars
- 685
- Forks
- 17
- Avg merge
- 23h 34m
- Merged PRs (30d)
- 24
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from buckaroo-data/buckaroo
-
Histograms JS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
buckaroo-data/buckaroo#1089 · 1 comment ·
Maintainers usually reply within 1 day
-
Histograms
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
buckaroo-data/buckaroo#1087 · 1 comment ·
Maintainers usually reply within 1 day
-
Histograms
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
buckaroo-data/buckaroo#1086 · 1 comment ·
Maintainers usually reply within 1 day
-
Histograms
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
buckaroo-data/buckaroo#1083 · 1 comment ·
Maintainers usually reply within 1 day
-
Histograms
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
buckaroo-data/buckaroo#1082 · 1 comment ·
Maintainers usually reply within 1 day
All issues in buckaroo-data/buckaroo
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
WLAN-Pi/wlanpi-profiler#341 ·
Maintainers usually reply within 1 day
-
Memory leak: the shared `validation_aborted_error` keeps every traceback it is raised throughPossibly taken @Fire162 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
graphql-python/graphql-core#287 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
roman-corgi/ctc-dip#160 ·
Maintainers usually reply within 1 day
-
type-bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
render_findings.py reads and writes in the host's default encoding, so findings.html breaks on a cp1252 Windows hostPossibly taken @Aaqibhafeezkhan claimed this today. Openbug good first issue mentored python size: XS up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dheerajjha/mcp-migrate#366 · 1 comment ·
Maintainers usually reply within 1 day