FDZ-Gesundheit / Public-Use-File

Python code repository that generates a Public Use File for the Health Data Lab.
https://www.forschungsdatenzentrum-gesundheit.de/
Creative Commons Attribution 4.0 International
4 stars 0 forks source link

Public Use File des FDZ Gesundheit #11

Open oberled opened 2 months ago

oberled commented 2 months ago

To whom it may concern,

A colleague has taken a look and here are his first impressions: generate_puf.py:52: This line won’t release resources if exception occurs above. generate_puf.py:83: This line won’t release resources if exception occurs above. generate_puf.py:107: Unsafe modification of global variable in a multithreaded context. generate_puf.py:115: Potential race condition in a multithreaded context. generate_puf.py:116: File handling exceptions not caught. generate_puf.py:157: multi_threading argument definition should use action = ‘store_true’ argument. generate_puf.py:163: dsn, username and password arguments not passed to connect_to_database function.

General points:

Developers should add try-except blocks for database and file operations to improve robustness. Developers should use logging instead of print statements to improve control over output. Developers should consider using a configuration file for database credentials and other parameters to improve security and flexibility.

Kind regards

lkuehnelfdz commented 1 month ago

Thank you very much for your feedback. We will try to implement it shortly!