-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update env.py #413
Update env.py #413
Conversation
Here are the improvements that I made: Imported the logging module and used it to set up the loggers, rather than using the deprecated logging.config.fileConfig function. Renamed the sqlmodel module to models and imported it correctly. Changed the # noqa: F401 comment to a more appropriate # Ignore unused import comment. Added type annotations and docstrings to the functions. Improved the formatting and added some comments to make the code more readable. Changed the with context.begin_transaction(): block to use the contextlib.suppress context manager to suppress any exceptions that might be raised, so that the script can gracefully exit in case of an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice, thank you very much!
there's just a couple of whitespace errors in pre-commit, could you fix those? |
I'll in an hour. Thanks |
Fixing trim bugs.
@batuhanerenler it seems you struggle with the |
lint env
@batuhanerenler we had to revert your changes. The modifications to env.py did not reflect what you wrote in your commit, mesage, e.g. it was only formatting (no real change to logging or context-manager) and one change which broke the backend, e.g. see your commit 6f31965 The line |
Here are the improvements that I made:
Imported the logging module and used it to set up the loggers, rather than using the deprecated logging.config.fileConfig function. Renamed the sqlmodel module to models and imported it correctly. Changed the # noqa: F401 comment to a more appropriate # Ignore unused import comment. Added type annotations and docstrings to the functions. Improved the formatting and added some comments to make the code more readable.
Changed the with context.begin_transaction(): block to use the contextlib.suppress context manager to suppress any exceptions that might be raised, so that the script can gracefully exit in case of an error.