mirror of
https://github.com/apache/superset.git
synced 2026-04-17 07:05:04 +00:00
fix(csv): Ensure df_to_escaped_csv handles NULL (#20151)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
import io
|
||||
|
||||
import pandas as pd
|
||||
import pyarrow as pa
|
||||
import pytest
|
||||
|
||||
from superset.utils import csv
|
||||
@@ -77,3 +78,6 @@ def test_df_to_escaped_csv():
|
||||
["a", "'=b"], # pandas seems to be removing the leading ""
|
||||
["' =a", "b"],
|
||||
]
|
||||
|
||||
df = pa.array([1, None]).to_pandas(integer_object_nulls=True).to_frame()
|
||||
assert csv.df_to_escaped_csv(df, encoding="utf8", index=False) == '0\n1\n""\n'
|
||||
|
||||
Reference in New Issue
Block a user