xorq stats: numeric histogram leaves out empty buckets, so gaps in the data disappear
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- data-visualization
Research direction
Start with _numeric_histogram in xorq_stats_v2.py around line 261, then follow how its returned rows become bars around line 305. Reproduce the example from the issue and check that the output includes all ten bucket indices. Done means missing buckets appear with population 0, so gaps in the data remain visible.
Written by the indexing model from the issue text.
Description
Problem
_numeric_histogram (xorq_stats_v2.py:261) groups rows by bucket index and makes one bar per returned row (line 305), so a bucket with no rows has no bar. The chart draws the bars side by side, so a gap in the data disappears: values from 0 to 10 and from 90 to 100 draw three adjacent bars, 0–10, 10–20 and 90–100. Pandas and polars always draw ten buckets, with 0 for the empty ones.
import pyarrow as pa
import xorq.api as xo
from buckaroo.customizations.xorq_stats_v2 import XORQ_STATS_V2
from buckaroo.pluggable_analysis_framework.xorq_stat_pipeline import XorqStatPipeline
values = [float(i) for i in range(11)] * 10 + [float(i) for i in range(90, 101)] * 10
sd, _ = XorqStatPipeline(XORQ_STATS_V2, unit_test=False).process_table(xo.memtable(pa.table({"a": values}), name="t"))
print(sd["a"]["histogram"])
# [{'name': '0–10', 'population': 45.5}, {'name': '10–20', 'population': 4.5}, {'name': '90–100', 'population': 50.0}]
Suggested fix
Emit all ten buckets, with 0 for the indices the query didn't return.
Context
Found while probing histogram edge cases after #1069. Reproduces on main at e88ace91.
- 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 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
-
histogram: numeric bars are a percentage of the bucketed values, the NA bar a percentage of all rowsOpenHistograms
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
buckaroo-data/buckaroo#1079 · 1 comment ·
Maintainers usually reply within 1 day
All issues in buckaroo-data/buckaroo
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
NVIDIA/flare-local-inference#90 ·
Maintainers usually reply within 1 day
-
area/streaming comp/gateway P2 platform/telegram type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#144897 ·
Maintainers usually reply within 1 day
-
request-theme
Difficulty 1/5 Under an hour Newbie friendliness 66/100
LizardByte/ThemerrDB#9575 ·
Maintainers usually reply within 1 day
-
author-page correction
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
acl-org/acl-anthology#10599 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
zilliztech/memsearch#818 ·
Maintainers usually reply within 1 day