Skip to content
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

FEAT-#4622: Unify data type of log_level in logging module #6992

Merged
merged 2 commits into from Mar 4, 2024

Conversation

arunjose696
Copy link
Collaborator

What do these changes do?

  • first commit message and PR title follow format outlined here

    NOTE: If you edit the PR title to match this format, you need to add another commit (even if it's empty) or amend your last commit for the CI job that checks the PR title to pick up the new PR title.

  • passes flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
  • passes black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
  • signed commit with git commit -s
  • Resolves Unify type of log_level in logging module #4622?
  • tests added and passing
  • module layout described at docs/development/architecture.rst is up-to-date

@arunjose696 arunjose696 changed the title FEAT-modin-project#4622: Unify data type of log_level in logging module FEAT-#4622: Unify data type of log_level in logging module Mar 4, 2024
Signed-off-by: arunjose696 <arunjose696@gmail.com>
@@ -36,6 +37,16 @@
__LOGGER_CONFIGURED__: bool = False


class LogLevel(IntEnum): # noqa: PR01
"""Enumerator to Specify the valid values of LogLevel accepted by Logger.setLevel()."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""Enumerator to Specify the valid values of LogLevel accepted by Logger.setLevel()."""
"""Enumerator to specify the valid values of LogLevel accepted by Logger.setLevel()."""

Why noqa?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was getting traceback in doc_checker.py that {'value', 'names', 'start', 'type', 'module', 'qualname'} not documented, could see other intEnum using #noqa, so used this in this enum as well.

@@ -27,8 +27,8 @@ def __init__(self, namespace):
self.messages = collections.defaultdict(list)
self.namespace = namespace

def info(self, message, *args, **kw):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why changed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In previous impl, as log_level was a string the logger was called as below,

logger_level = getattr(logger, log_level)
logger_level(start_line)

now as log level is not a string(but int) this has been changed to call
logger.log(log_level,message)

Co-authored-by: Iaroslav Igoshev <Poolliver868@mail.ru>
@YarShev YarShev merged commit cd3d0c6 into modin-project:master Mar 4, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify type of log_level in logging module
2 participants