Skip to content

Commit ad714f2

Browse files
committed
Rename variables; so they do not shadow other variables in outer scope
1 parent 63cb8ce commit ad714f2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

main.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@
6868
## ...repeat for each job
6969
#####################################################################
7070
def write_data(chunk):
71-
path = os.path.join(chunk[0], '')
72-
job_name = chunk[1]
73-
header = chunk[2]
74-
rows = chunk[3]
71+
new_path = os.path.join(chunk[0], '')
72+
new_job_name = chunk[1]
73+
new_header = chunk[2]
74+
new_rows = chunk[3]
7575
num = multiprocessing.current_process().name[16:]
76-
filename = f'{path}{job_name}.{num}.csv.gz'
76+
filename = f'{new_path}{new_job_name}.{num}.csv.gz'
7777
if os.path.exists(filename) is False:
7878
with gzip.open(filename, 'at', encoding='utf-8', newline='') as f:
7979
csv_writer = csv.writer(f, quoting=csv.QUOTE_NONNUMERIC)
80-
csv_writer.writerows(header)
80+
csv_writer.writerows(new_header)
8181
with gzip.open(filename, 'at', encoding='utf-8', newline='') as f:
8282
csv_writer = csv.writer(f, quoting=csv.QUOTE_NONNUMERIC)
83-
csv_writer.writerows(rows)
83+
csv_writer.writerows(new_rows)
8484

8585

8686
# 1

0 commit comments

Comments
 (0)