-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
status: pending releaseThe fix have been merged but not yet released to PyPIThe fix have been merged but not yet released to PyPItype: bug
Description
System Information
- Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): NA
- Framework Version: NA
- Python Version: 3.6.3
- CPU or GPU: NA
- Python SDK Version: sagemaker-1.18.14.post1 (current version served by
pip install sagemaker) - Are you using a custom image: no
Describe the problem
Simply importing the sagemaker module alterates the logging module configuration.
Minimal repro / logs
Consider the following code:
import logging
logging.basicConfig(level='DEBUG',
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M')
logging.debug("debug")
logging.info('info')
logging.error('error')
logging.warning("WARNING")When ran, will output:
04-18 09:15 root DEBUG debug
04-18 09:15 root INFO info
04-18 09:15 root ERROR error
04-18 09:15 root WARNING WARNING
as expected. Now, the modified code, the only difference being the import of the sagemaker module:
import logging
import sagemaker
logging.basicConfig(level='DEBUG',
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M')
logging.debug("debug")
logging.info('info')
logging.error('error')
logging.warning("WARNING")will output:
WARNING:root:pandas failed to import. Analytics features will be impaired or broken.
ERROR:root:error
WARNING:root:WARNING
The logging level and formatting has been overwritten (the warning about pandas is not the problem I'm pointing at).
phamquiluan and zhlzhl
Metadata
Metadata
Assignees
Labels
status: pending releaseThe fix have been merged but not yet released to PyPIThe fix have been merged but not yet released to PyPItype: bug