Skip to content

Commit a183f13

Browse files
fix concat-column-field
1 parent b8fa1dc commit a183f13

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

bin/concat-column-field.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ def process_column_fields(column_field_dir, input_dir):
3232
w.writeheader()
3333

3434

35-
for path in glob.glob(f"{input_dir}/*/*.csv"):
36-
m = re.search(r"/([a-zA-Z0-9_-]+)/([a-f0-9]+).csv$", path)
37-
pipeline = m.group(1)
38-
resource = m.group(2)
39-
40-
with open(path, newline="") as infile:
41-
for row in csv.DictReader(infile):
42-
row["resource"] = resource
43-
row["dataset"] = pipeline
44-
w.writerow(row)
45-
35+
for path in glob.glob(f"{input_dir}/*/*.csv"):
36+
m = re.search(r"/([a-zA-Z0-9_-]+)/([a-f0-9]+).csv$", path)
37+
pipeline = m.group(1)
38+
resource = m.group(2)
39+
40+
with open(path, newline="") as infile:
41+
for row in csv.DictReader(infile):
42+
row["resource"] = resource
43+
row["dataset"] = pipeline
44+
w.writerow(row)
45+
46+
if __name__ == "__main__":
47+
process_column_fields()

0 commit comments

Comments
 (0)