fix: silence deprecation warnings causing noisy production logs (#38128)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Amin Ghadersohi
2026-03-02 13:55:00 -05:00
committed by GitHub
parent 00a1487705
commit 01d5245cd2
7 changed files with 41 additions and 20 deletions

View File

@@ -45,6 +45,13 @@ class DefaultLoggingConfigurator( # pylint: disable=too-few-public-methods
logging.basicConfig(format=app_config["LOG_FORMAT"])
logging.getLogger().setLevel(app_config["LOG_LEVEL"])
# Route Python warnings through the logging framework so they get
# proper log-level formatting instead of raw stderr output. Without
# this, the warnings module writes multi-line text to stderr where
# the source-code context line has no level prefix, causing log
# aggregators to misclassify it as an error.
logging.captureWarnings(True)
if app_config["ENABLE_TIME_ROTATE"]:
logging.getLogger().setLevel(app_config["TIME_ROTATE_LOG_LEVEL"])
handler = TimedRotatingFileHandler(

View File

@@ -54,5 +54,5 @@ def resample(
else:
_df = getattr(df.resample(rule), method)()
if method in ("ffill", "bfill"):
_df = _df.fillna(method=method)
_df = getattr(_df, method)()
return _df