Skip to content

Commit

Permalink
Merge pull request apache#13 from ASUS-AICS/fix_Null_become_None_string
Browse files Browse the repository at this point in the history
[Bug] Fix Null char becomes None
  • Loading branch information
ArcherTsai authored May 28, 2020
2 parents 58526cf + fc4b0a3 commit 53db46a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2852,10 +2852,15 @@ def generate(header_has_type):
continue

for item in row:
# Escape double quotes
if '"' in str(item):
item = item.replace('"', '""')
s += f'"{item}",'
# Avoid converting None to "None"
if item == None:
s += ','
else:
# Escape double quotes
if '"' in str(item):
item = item.replace('"', '""')
s += f'"{item}",'
# Replace the latest "," with newline
s = s[:-1] + '\n'
yield s

Expand Down

0 comments on commit 53db46a

Please sign in to comment.