fix(csv): Ensure df_to_escaped_csv handles NULL (#20151)

Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
John Bodley
2022-05-31 09:56:25 -07:00
committed by GitHub
parent 3e3fbccdcb
commit 97ce920d49
2 changed files with 11 additions and 2 deletions

View File

@@ -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'