Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix INT128_MIN write #1152

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

fix INT128_MIN write #1152

wants to merge 2 commits into from

Conversation

belous-dp
Copy link

this PR fixes #1151

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.47%. Comparing base (41a6875) to head (ecc77e2).

Files with missing lines Patch % Lines
src/write.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1152   +/-   ##
=======================================
  Coverage   90.47%   90.47%           
=======================================
  Files           9        9           
  Lines        2319     2319           
=======================================
  Hits         2098     2098           
  Misses        221      221           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -435,7 +435,7 @@ end

function writecell(buf, pos, len, io, x::Integer, opts)
if x < 0
x *= -1
x = unsigned(-(x + 1)) + 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
x = unsigned(-(x + 1)) + 1
x = Base.uabs(x)

This should fix the BigInt issue.

@nhz2
Copy link
Contributor

nhz2 commented Jan 3, 2025

This breaks writing BigInt:

df = DataFrame(a = BigInt[])
push!(df, [big(-170141183460469231731687303715884105728)])
CSV.write("a.csv", df)
ERROR: MethodError: no method matching Unsigned(::BigInt)
The type `Unsigned` exists, but no method is defined for this combination of argument types when trying to construct it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

INT128_MIN write error
2 participants