Skip to content

fix(date_parser): suppress noisy parsedatetime DEBUG logs (#33365)#40144

Merged
rusackas merged 2 commits into
masterfrom
tdd/issue-33365-parsedatetime-log-noise
May 18, 2026
Merged

fix(date_parser): suppress noisy parsedatetime DEBUG logs (#33365)#40144
rusackas merged 2 commits into
masterfrom
tdd/issue-33365-parsedatetime-log-noise

Conversation

@rusackas
Copy link
Copy Markdown
Member

@rusackas rusackas commented May 15, 2026

SUMMARY

Closes #33365.

parsedatetime emits a noisy DEBUG record (eval now with context - False, False) on every relative-date evaluation that runs through datetime_eval. Superset has no actionable use for that internal library trace, and it floods production logs whenever the root logger is at DEBUG. The reporter notes the line appears in dozens of unrelated issue threads, so this hits a wide range of deployments.

This PR:

  1. Suppresses the parsedatetime logger to WARNING at module load in superset/utils/date_parser.py (one-liner). Real failures still surface — just not the per-call chatter.
  2. Adds a regression test (test_datetime_eval_does_not_emit_parsedatetime_debug_logs) that captures all log records at DEBUG level during a single datetime_eval call and asserts none come from the parsedatetime logger. Locks in the suppression so a future refactor that drops the setLevel call fails CI immediately.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — log-volume change only. Verified locally:

$ python3 -c "
import logging
records = []
class H(logging.Handler):
    def emit(self, r): records.append(r)
root = logging.getLogger(); root.setLevel(logging.DEBUG); root.addHandler(H())
from superset.utils.date_parser import datetime_eval
datetime_eval(\"datetime('now')\")
print('parsedatetime records:', sum(1 for r in records if r.name.startswith('parsedatetime')))
"
parsedatetime records: 0

(Before the fix: parsedatetime records: 1.)

TESTING INSTRUCTIONS

pytest tests/unit_tests/utils/date_parser_tests.py::test_datetime_eval_does_not_emit_parsedatetime_debug_logs -v

ADDITIONAL INFORMATION

🤖 Generated with Claude Code

Closes #33365

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 15, 2026

Code Review Agent Run #8c7184

Actionable Suggestions - 0
Additional Suggestions - 1
  • tests/unit_tests/utils/date_parser_tests.py - 1
    • Test will fail without fix · Line 727-762
      The test is added to verify that parsedatetime debug logs are silenced, but the silencing code is not implemented in the diff, so the test will fail.
Review Details
  • Files reviewed - 1 · Commit Range: 0e4ff14..0e4ff14
    • tests/unit_tests/utils/date_parser_tests.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.17%. Comparing base (2b71d96) to head (ec5ac32).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #40144   +/-   ##
=======================================
  Coverage   64.17%   64.17%           
=======================================
  Files        2590     2590           
  Lines      138087   138088    +1     
  Branches    32039    32039           
=======================================
+ Hits        88615    88616    +1     
  Misses      47947    47947           
  Partials     1525     1525           
Flag Coverage Δ
hive 39.47% <100.00%> (+<0.01%) ⬆️
mysql 59.18% <100.00%> (+<0.01%) ⬆️
postgres 59.25% <100.00%> (+<0.01%) ⬆️
presto 41.16% <100.00%> (+<0.01%) ⬆️
python 60.69% <100.00%> (+<0.01%) ⬆️
sqlite 58.89% <100.00%> (+<0.01%) ⬆️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

`parsedatetime` emits 'eval now with context - False, False' at DEBUG on
every relative-date evaluation. Superset has no actionable use for that
internal trace, and it floods production logs whenever the root logger
is at DEBUG (a configuration the user reports hitting in #33365 and that
appears in dozens of other unrelated issue threads).

Pin the library's own logger to WARNING at module load. Real failures
still surface — just not the per-call chatter.

The companion test added in this PR's earlier commit asserts no DEBUG
records from `parsedatetime` are emitted during `datetime_eval`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rusackas rusackas changed the title test(date_parser): assert parsedatetime DEBUG logs are silenced (#33365) fix(date_parser): suppress noisy parsedatetime DEBUG logs (#33365) May 15, 2026
@rusackas rusackas requested a review from sadpandajoe May 15, 2026 04:53
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 15, 2026

Code Review Agent Run #fb20a7

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 0e4ff14..ec5ac32
    • superset/utils/date_parser.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas rusackas merged commit 3a9c54a into master May 18, 2026
79 of 81 checks passed
@rusackas rusackas deleted the tdd/issue-33365-parsedatetime-log-noise branch May 18, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logs littered with "parsedatetime:eval now with context - False, False"

3 participants