Fix CSV writer on Windows
PiperOrigin-RevId: 325892185 Change-Id: I96053328785323a40450e4b33704d873a6c6f38b
This commit is contained in:
parent
e477d16d52
commit
6411114cbd
@ -364,8 +364,9 @@ def main():
|
|||||||
print("DRY RUN: Generated this TSV row:")
|
print("DRY RUN: Generated this TSV row:")
|
||||||
print("\t".join(map(str, next_tsv_row)))
|
print("\t".join(map(str, next_tsv_row)))
|
||||||
else:
|
else:
|
||||||
with open("data.tsv", "w") as tsvfile:
|
with open("data.tsv", "w", newline="") as tsvfile:
|
||||||
writer = csv.writer(tsvfile, delimiter="\t", quoting=csv.QUOTE_MINIMAL)
|
writer = csv.writer(tsvfile, delimiter="\t", quoting=csv.QUOTE_MINIMAL,
|
||||||
|
lineterminator=os.linesep)
|
||||||
writer.writerow(next_tsv_row)
|
writer.writerow(next_tsv_row)
|
||||||
bq([
|
bq([
|
||||||
"load", "--source_format", "CSV", "--field_delimiter", "tab",
|
"load", "--source_format", "CSV", "--field_delimiter", "tab",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user