mirror of
https://github.com/Watchful1/PushshiftDumps.git
synced 2025-07-27 08:35:16 -04:00
Better logging
This commit is contained in:
parent
15d88a138f
commit
143a40fc23
2 changed files with 128 additions and 2 deletions
|
@ -340,8 +340,12 @@ if __name__ == '__main__':
|
|||
for file in input_files:
|
||||
with open(file.monthly_count_file, 'r') as input_handle:
|
||||
for line in input_handle:
|
||||
field, count = line.strip().split("\t")
|
||||
field_counts[field] = count
|
||||
try:
|
||||
field, count = line.strip().split("\t")
|
||||
field_counts[field] = count
|
||||
except Exception as err:
|
||||
log.info(f"Line failed in file {file.monthly_count_file}: {line}")
|
||||
raise
|
||||
|
||||
sorted_counts = sorted(field_counts.items(), key=lambda item: item[1], reverse=True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue