• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

petl-developers / petl / 43492268764
94%

Build:
DEFAULT BRANCH: master
Ran 13 Nov 2026 07:30PM UTC
Jobs 1
Files 136
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Nov 2026 07:26PM UTC coverage: 93.772% (+0.03%) from 93.745%
43492268764

push

github

web-flow
Handle missing and mixed-type pivot categories (#811)

`pivot()` raises `TypeError` before yielding a header when category
values cannot be directly compared, for example an ordinary missing
category alongside a string:

```python
import petl as etl

source = [('region', 'category', 'sales'),
          ('north', None, 3), ('north', 'retail', 10),
          ('south', 'retail', 7)]
list(etl.pivot(source, 'region', 'category', 'sales', sum))
# TypeError: '<' not supported between instances of 'str' and 'NoneType'
```

The source sort already accepts these values. The failure is the
separate native sort of the discovered output categories.

## Changes

Use the existing `Comparable` key to order pivot categories, consistent
with the mixed-type ordering used by `sort()` and `recast()`. The
example then produces:

```python
[('region', None, 'retail'), ('north', 3, 10), ('south', None, 7)]
```

48 of 48 new or added lines in 2 files covered. (100.0%)

16832 of 17950 relevant lines covered (93.77%)

0.94 hits per line

Jobs
ID Job ID Ran Files Coverage
1 43492268764.1 13 Nov 2026 07:30PM UTC 136
93.77
GitHub Action Run
Source Files on build 43492268764
  • Tree
  • List 136
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 88565da3 on github
  • Prev Build on master (#43125568317)
  • Next Build on master (#43493020630)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc