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

Decimal Column with Value 0 Causes Failure in Python Binding #2193

Closed
bnewman-tech opened this issue Feb 19, 2024 · 1 comment
Closed

Decimal Column with Value 0 Causes Failure in Python Binding #2193

bnewman-tech opened this issue Feb 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working on-hold Issues and Pull Requests that are on hold for some reason

Comments

@bnewman-tech
Copy link

Environment

Delta-rs version: 0.15.3

Binding: Python

Environment:

  • Cloud provider: Azure Blob
  • OS: MacOS
  • Other:

Bug

What happened:

When attempting to read or interact with a Delta table that contains a decimal datatype column with a value of 0, operations fail.
The error is "Parser error: can't parse the string value 0E-10 to decimal."
This issue prevents any interaction with tables that include such decimal values.

What you expected to happen:
The expectation is to be able to read from and interact with Delta tables regardless of the presence of decimal columns with a value of 0.

How to reproduce it:

from decimal import Decimal
from deltalake import write_deltalake
import pandas as pd

# Create a DataFrame with a decimal column
df = pd.DataFrame({"num": [1, 2, 3], "letter": ["a", "b", "c"]})
df["decimal_col"] = [Decimal(0), Decimal("1.0000000000"), Decimal("2.0000000000")]

# Display the DataFrame
print(df)

# Attempt to write the DataFrame to a Delta table
write_deltalake(
    "libs/deltalake/tables/some-table", df, overwrite_schema=True, mode="overwrite"
)

Error Message:

Exception has occurred: Exception
Parser error: can't parse the string value 0E-10 to decimal

@bnewman-tech bnewman-tech added the bug Something isn't working label Feb 19, 2024
@ion-elgreco ion-elgreco self-assigned this Mar 24, 2024
@ion-elgreco ion-elgreco added the on-hold Issues and Pull Requests that are on hold for some reason label Mar 24, 2024
@leo-schick
Copy link

It looks to me that this is the same issue as #2221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working on-hold Issues and Pull Requests that are on hold for some reason
Projects
None yet
Development

No branches or pull requests

3 participants