Currently if there is a corrupt file in a dir the whole processing crashes with:
Processing file 4 ./economicCollapse_comments.zst
Error reading file: ./economicCollapse_comments.zst
Traceback (most recent call last):
File "arctic_shift/scripts/fileStreams.py", line 33, in getZstFileJsonStream
chunk = reader.read(chunk_size)
zstd.ZstdError: zstd decompress error: Unknown frame descriptor
Traceback (most recent call last):
File "arctic_shift/scripts/processFiles.py", line 64, in <module>
main()
File "arctic_shift/scripts/processFiles.py", line 57, in main
processFolder(fileOrFolderPath)
File "arctic_shift/scripts/processFiles.py", line 53, in processFolder
processFile(file)
File "arctic_shift/scripts/processFiles.py", line 37, in processFile
print(f"\rRow {i+1}")
UnboundLocalError: local variable 'i' referenced before assignment
it fails in:
print(f"\rRow {i+1}")
because the generator was empty to start with.
I tried to solve it cleanly on the generator side, but it's far from trivial the way it has been designed, so it looks like setting the default i=0 solves it in the most simple way - not the cleanest solution but it works.
There are probably other ways to fix it, so this is just a suggestion.
Currently if there is a corrupt file in a dir the whole processing crashes with:
it fails in:
because the generator was empty to start with.
I tried to solve it cleanly on the generator side, but it's far from trivial the way it has been designed, so it looks like setting the default
i=0
solves it in the most simple way - not the cleanest solution but it works.There are probably other ways to fix it, so this is just a suggestion.