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

Import of sagemaker changes logging level #4945

Open
alexanderc-opti opened this issue Dec 3, 2024 · 1 comment
Open

Import of sagemaker changes logging level #4945

alexanderc-opti opened this issue Dec 3, 2024 · 1 comment
Assignees

Comments

@alexanderc-opti
Copy link

Describe the bug
Import of sagemaker (ver 2.235.2) changes logging level to INFO.

To reproduce
Tried with clean poetry env, where only sagemaker package is installed

import logging

logger = logging.getLogger(__name__)
print(logging.getLevelName(logger.getEffectiveLevel()))

import sagemaker

logger = logging.getLogger(__name__)
print(logging.getLevelName(logger.getEffectiveLevel()))

Expected behavior
Import of package shouldn't affect global logging levels.

Screenshots or logs

❯ poetry run python
Python 3.12.1 | packaged by Anaconda, Inc. | (main, Jan 19 2024, 09:45:58) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>>
>>> logger = logging.getLogger(__name__)
>>> print(logging.getLevelName(logger.getEffectiveLevel()))
WARNING
>>>
>>> import sagemaker
/Users/alex/Library/Caches/pypoetry/virtualenvs/sm-test--bhHLzdX-py3.12/lib/python3.12/site-packages/pydantic/_internal/_fields.py:192: UserWarning: Field name "json" in "MonitoringDatasetFormat" shadows an attribute in parent "Base"
  warnings.warn(
sagemaker.config INFO - Not applying SDK defaults from location: /Library/Application Support/sagemaker/config.yaml
sagemaker.config INFO - Not applying SDK defaults from location: /Users/alex/Library/Application Support/sagemaker/config.yaml
>>>
>>> logger = logging.getLogger(__name__)
>>> print(logging.getLevelName(logger.getEffectiveLevel()))
INFO
>>> sagemaker.__version__
'2.235.2'

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: 2.235.2
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): N/A
  • Framework version: N/A
  • Python version: 3.12.1
  • CPU or GPU: CPU
  • Custom Docker image (Y/N): N
@jonnyarnold
Copy link

It appears that this affects versions >=2.234.0. (So the issue must have been introduced here.)

@pintaoz-aws pintaoz-aws self-assigned this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants