Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

xorq stats: numeric histogram leaves out empty buckets, so gaps in the data disappear

Open Beginner friendly
#1,087 1 comment 0 reactions 0 assignees View on GitHub

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

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

Histograms

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from buckaroo-data/buckaroo

All issues in buckaroo-data/buckaroo

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.