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

petl-developers / petl / 32295565417
92%

Build:
DEFAULT BRANCH: master
Ran 19 Aug 2026 07:58PM UTC
Jobs 1
Files 127
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

19 Aug 2026 07:54PM UTC coverage: 91.898% (+0.03%) from 91.864%
32295565417

push

github

web-flow
Fix avro decimal precision and scale inferred from Decimal values (#706)

precision_and_scale() derives the decimal logicalType of a column from a
sample of its values. It is a copy of fastavro's bytes-decimal encoder with
the `delta = exp + scale` rescale hardcoded to 1 and the digit count taken
from the rescaled integer with ceil(log10(...)), which leaves four defects:

* any zero aborts toavro() with "ValueError: math domain error", since
  log10(0) is undefined and every zero has (0,) as its digits;
* a value with more than 8 fractional digits gets a scale larger than the
  precision, which the spec forbids ("Scale must be zero or a positive
  integer less than or equal to the precision") and fastavro rejects;
* a positive exponent is read as fractional digits, so Decimal('1E+2') is
  declared with a scale of 2 instead of 0;
* the precision of a column is the greatest precision of its values, but
  writing rescales each value to the scale of the schema, which widens its
  unscaled integer beyond the declared precision.

Count the digits from the coefficient and the exponent instead, and combine
the sample on the integer part and the scale separately. Non finite values
have no decimal representation at all, so they now raise a clear error
instead of failing inside the digit count.

99 of 101 new or added lines in 2 files covered. (98.02%)

14098 of 15341 relevant lines covered (91.9%)

0.92 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
97.35
0.16% petl/test/io/test_avro.py
Jobs
ID Job ID Ran Files Coverage
1 32295565417.1 19 Aug 2026 07:58PM UTC 127
91.9
GitHub Action Run
Source Files on build 32295565417
  • Tree
  • List 127
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 2e01e169 on github
  • Prev Build on master (#30962876524)
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