From bd50ba325b10a1a9cdb452fe40c96f959825797c Mon Sep 17 00:00:00 2001 From: Zubarev Grigoriy Date: Sat, 5 Oct 2024 17:14:02 -0400 Subject: [PATCH] Use logging.WARNING instead of logging.WARN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `WARN` constant is an undocumented alias for `WARNING`. Whilst it’s not deprecated, it’s not mentioned at all in the documentation. This references one of `flake8-logging` plugins [rule](https://github.com/adamchainz/flake8-logging?tab=readme-ov-file#log009-warn-is-undocumented-use-warning-instead). ### Description Changed all uses of `logging.WARN` to `logging.WARNING`. ### Checklist This pull request is: - [x] A documentation / typographical error fix - Good to go, no issue or tests are needed - [ ] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #` in the commit message - please include tests. **Have a nice day!** Closes: #1548 Pull-request: https://github.com/sqlalchemy/alembic/pull/1548 Pull-request-sha: 249b9a2942037f8da9f2db5736d1d988435b6fe5 Change-Id: I7c64ce9bb18af551c761ed9216713ee02cbbb83b --- alembic/templates/async/alembic.ini.mako | 4 ++-- alembic/templates/generic/alembic.ini.mako | 4 ++-- alembic/templates/multidb/alembic.ini.mako | 4 ++-- alembic/testing/env.py | 8 ++++---- docs/build/tutorial.rst | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/alembic/templates/async/alembic.ini.mako b/alembic/templates/async/alembic.ini.mako index 46a0904e..7eee9132 100644 --- a/alembic/templates/async/alembic.ini.mako +++ b/alembic/templates/async/alembic.ini.mako @@ -90,12 +90,12 @@ keys = console keys = generic [logger_root] -level = WARN +level = WARNING handlers = console qualname = [logger_sqlalchemy] -level = WARN +level = WARNING handlers = qualname = sqlalchemy.engine diff --git a/alembic/templates/generic/alembic.ini.mako b/alembic/templates/generic/alembic.ini.mako index dd4ea588..f1f76cae 100644 --- a/alembic/templates/generic/alembic.ini.mako +++ b/alembic/templates/generic/alembic.ini.mako @@ -92,12 +92,12 @@ keys = console keys = generic [logger_root] -level = WARN +level = WARNING handlers = console qualname = [logger_sqlalchemy] -level = WARN +level = WARNING handlers = qualname = sqlalchemy.engine diff --git a/alembic/templates/multidb/alembic.ini.mako b/alembic/templates/multidb/alembic.ini.mako index d5cc86f1..bf383ea1 100644 --- a/alembic/templates/multidb/alembic.ini.mako +++ b/alembic/templates/multidb/alembic.ini.mako @@ -97,12 +97,12 @@ keys = console keys = generic [logger_root] -level = WARN +level = WARNING handlers = console qualname = [logger_sqlalchemy] -level = WARN +level = WARNING handlers = qualname = sqlalchemy.engine diff --git a/alembic/testing/env.py b/alembic/testing/env.py index 5df7ef82..c37b4d30 100644 --- a/alembic/testing/env.py +++ b/alembic/testing/env.py @@ -118,7 +118,7 @@ def _sqlite_testing_config(sourceless=False, future=False): keys = console [logger_root] -level = WARN +level = WARNING handlers = console qualname = @@ -171,7 +171,7 @@ def _multi_dir_testing_config(sourceless=False, extra_version_location=""): keys = console [logger_root] -level = WARN +level = WARNING handlers = console qualname = @@ -216,7 +216,7 @@ def _no_sql_testing_config(dialect="postgresql", directives=""): keys = console [logger_root] -level = WARN +level = WARNING handlers = console qualname = @@ -497,7 +497,7 @@ def _multidb_testing_config(engines): keys = console [logger_root] -level = WARN +level = WARNING handlers = console qualname = diff --git a/docs/build/tutorial.rst b/docs/build/tutorial.rst index 6cc16697..5fed9f4a 100644 --- a/docs/build/tutorial.rst +++ b/docs/build/tutorial.rst @@ -217,12 +217,12 @@ The file generated with the "generic" configuration looks like:: keys = generic [logger_root] - level = WARN + level = WARNING handlers = console qualname = [logger_sqlalchemy] - level = WARN + level = WARNING handlers = qualname = sqlalchemy.engine