mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(excel export): big number truncation handling (#32739)
This commit is contained in:
@@ -105,3 +105,27 @@ def test_column_data_types_with_failing_conversion():
|
||||
assert not is_numeric_dtype(df["col1"])
|
||||
assert not is_numeric_dtype(df["col2"])
|
||||
assert not is_numeric_dtype(df["col3"])
|
||||
|
||||
|
||||
def test_column_data_types_with_large_numeric_values():
|
||||
df = pd.DataFrame(
|
||||
{
|
||||
"big_number": [
|
||||
10**14,
|
||||
999999999999999,
|
||||
10**15 + 1,
|
||||
10**16,
|
||||
1100108628127863,
|
||||
2**54,
|
||||
],
|
||||
}
|
||||
)
|
||||
apply_column_types(df, [GenericDataType.NUMERIC])
|
||||
assert df["big_number"].tolist() == [
|
||||
100000000000000,
|
||||
999999999999999,
|
||||
"1000000000000001",
|
||||
"10000000000000000",
|
||||
"1100108628127863",
|
||||
"18014398509481984",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user