Skip to content

Commit 12444aa

Browse files
Use QUOTE_MINIMAL by default (#32)
1 parent acd5952 commit 12444aa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

redisgraph_bulk_loader/bulk_insert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def process_entities(entities):
5757
@click.option('--enforce-schema', '-d', default=False, is_flag=True, help='Enforce the schema described in CSV header rows')
5858
@click.option('--skip-invalid-nodes', '-s', default=False, is_flag=True, help='ignore nodes that use previously defined IDs')
5959
@click.option('--skip-invalid-edges', '-e', default=False, is_flag=True, help='ignore invalid edges, print an error message and continue loading (True), or stop loading after an edge loading failure (False)')
60-
@click.option('--quote', '-q', default=3, help='the quoting format used in the CSV file. QUOTE_MINIMAL=0,QUOTE_ALL=1,QUOTE_NONNUMERIC=2,QUOTE_NONE=3')
60+
@click.option('--quote', '-q', default=0, help='the quoting format used in the CSV file. QUOTE_MINIMAL=0,QUOTE_ALL=1,QUOTE_NONNUMERIC=2,QUOTE_NONE=3')
6161
# Buffer size restrictions
6262
@click.option('--max-token-count', '-c', default=1024, help='max number of processed CSVs to send per query (default 1024)')
6363
@click.option('--max-buffer-size', '-b', default=2048, help='max buffer size in megabytes (default 2048)')

redisgraph_bulk_loader/entity_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def __init__(self, filename, label, config):
137137

138138
# Initialize CSV reader that ignores leading whitespace in each field
139139
# and does not modify input quote characters
140-
self.reader = csv.reader(self.infile, delimiter=config.separator, skipinitialspace=True, quoting=config.quoting)
140+
self.reader = csv.reader(self.infile, delimiter=config.separator, skipinitialspace=True, quoting=config.quoting, escapechar='\\')
141141

142142
self.packed_header = b''
143143
self.binary_entities = []

test/test_bulk_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def test13_id_namespaces(self):
562562

563563
with open('/tmp/relations.tmp', mode='w') as csv_file:
564564
out = csv.writer(csv_file)
565-
out.writerow([':START_ID(User), :END_ID(Post)'])
565+
out.writerow([':START_ID(User)', ':END_ID(Post)'])
566566
out.writerow([0, 0])
567567
out.writerow([1, 1])
568568

0 commit comments

Comments
 (0)