klaytn / klaytn-etl

Python scripts for ETL (extract, transform and load) jobs for Klaytn blocks, transactions, ERC20 / ERC721 tokens, transfers, receipts, logs, contracts, internal transactions.
Other
21 stars 13 forks source link

Fix file save issues due to max lines #17

Closed yongchand closed 1 year ago

yongchand commented 1 year ago

There was an issue that file becomes empty when the length of file content is exactly same as file max lines. For example, if you run

klaytnetl export_block_group --start-block 11968130 --end-block 11971729 --enrich True --file-format json --file-maxlines 10000 --transactions-output transaction`

We can see that the first file has been saved safely, while second file is empty (which originally should contain 10000 rows) By adding if statement in close function, we can fix this issue.