Skip to content

fix: downgrade md5 namespace-fallback deprecation log to info - #43884

Merged
eschutho merged 1 commit into
apache:masterfrom
eschutho:fix/md5-namespace-warning-log-level
Sep 7, 2026
Merged

eschutho merged 1 commit into
apache:masterfrom
eschutho:fix/md5-namespace-warning-log-level

Conversation

@eschutho

@eschutho eschutho commented Sep 4, 2026

Copy link
Copy Markdown
Member

Decisions made that were not in the instructions
None.

What

Datadog prod logs show recurring warning-level noise: The 'md5' HASH_ALGORITHM is deprecated and retained only for backwards compatibility; prefer 'sha256' for namespace generation. from _uuid_namespace_from_md5 (superset/key_value/utils.py).

This fires via get_uuid_namespace_with_algorithm(seed, "md5") from two fallback-lookup call sites whenever HASH_ALGORITHM_FALLBACKS (default ["md5"]) resolves a legacy pre-SHA-256 entry:

  • superset/commands/dashboard/permalink/create.py:CreateDashboardPermalinkCommand.run -- a fallback hit does not migrate the legacy entry, so every future access of that permalink re-hits the md5 fallback and re-logs. Still indefinite.
  • superset/key_value/shared_entries.py:get_shared_value -- as of fix: commit migration write in get_shared_value to stop recurring md5 deprecation warning #42916 (merged 2026-08-12), a fallback hit now persists a migrated current-algorithm entry, so this path logs at most once per legacy entry, not indefinitely.

Either way, this is expected fallback behavior, not a one-off actionable event -- warning-level logging is the wrong severity for the repeat case.

Change

Downgrade the single logger.warning call in _uuid_namespace_from_md5 to logger.info. No other behavior change -- the md5 hashing/namespace-generation logic itself is untouched. Mirrors the identical downgrade already applied to QueryObject's deprecated-field warnings in #43520 for the same "expected, indefinite repeat" reasoning.

Test plan

  • Updated tests/unit_tests/key_value/utils_test.py (renamed test_uuid_namespace_from_md5_warns -> test_uuid_namespace_from_md5_logs_deprecation_at_info) to assert record.levelno == logging.INFO explicitly, not just message content. Verified it fails if reverted to logger.warning and passes on this fix.
  • uvx ruff@0.9.7 check and format --check clean on both changed files.
  • pytest tests/unit_tests/key_value/utils_test.py -- 24 passed.

_uuid_namespace_from_md5 fires on every legacy key-value/permalink
lookup that falls back to the deprecated md5 HASH_ALGORITHM. For the
permalink path this repeats indefinitely until each legacy entry is
migrated; apache#42916 already fixed the get_shared_value path to migrate
on first hit. Either way, expected fallback behavior doesn't warrant
WARNING severity. Mirrors the same downgrade already applied to
query_object.py's deprecated-field logging (apache#43520). Test pins the
exact log level so a regression back to warning is caught.
@bito-code-review

bito-code-review Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #b1aace

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset/key_value/utils.py - 1
    • Inaccurate precedent comment · Line 97-97
      The cited precedent doesn't exist: `superset/common/query_object.py` still logs deprecated fields at `logger.warning` (lines 228/236/248/257), and no fix: downgrade deprecated query_object field warnings to info #43520 downgrade appears in repo history. The downgrade rationale here (fires on every fallback lookup until migration) is sound on its own; drop the misleading reference.
Review Details
  • Files reviewed - 2 · Commit Range: 9970b31..9970b31
    • superset/key_value/utils.py
    • tests/unit_tests/key_value/utils_test.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

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

  • /review - Manually triggers an incremental AI Review.

  • /review full - 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

@netlify

netlify Bot commented Sep 4, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 9970b31
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a9af0a9d9872a0008bd70c6
😎 Deploy Preview https://deploy-preview-43884--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@eschutho

eschutho commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

@rebenitez1802 assigning you as reviewer on this one — you approved the closely-related #42916 (the superset/key_value/ get_shared_value md5-migration fix, same recurring-md5-deprecation-noise root cause), so you've got the most context here. This is the follow-on: it just downgrades the single logger.warning in _uuid_namespace_from_md5 to logger.info for the expected/indefinite-repeat fallback case (mirrors #43520's rationale). No behavior change; the md5 hashing/namespace logic is untouched. Thanks!

@codecov

codecov Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.65%. Comparing base (2548179) to head (9970b31).
⚠️ Report is 629 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #43884       +/-   ##
===========================================
+ Coverage   66.42%   78.65%   +12.23%     
===========================================
  Files        2857     2871       +14     
  Lines      161293   165784     +4491     
  Branches    37134    37976      +842     
===========================================
+ Hits       107133   130392    +23259     
+ Misses      52135    32893    -19242     
- Partials     2025     2499      +474     
Flag Coverage Δ
hive 37.77% <100.00%> (-0.47%) ⬇️
mysql 57.48% <100.00%> (-0.30%) ⬇️
postgres 57.51% <100.00%> (-0.32%) ⬇️
presto 39.66% <100.00%> (-0.54%) ⬇️
python 83.87% <100.00%> (+24.64%) ⬆️
sqlite 57.21% <100.00%> (-0.25%) ⬇️
unit 74.40% <100.00%> (-25.60%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@rebenitez1802 rebenitez1802 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve: correct, low-risk severity downgrade with a properly tightened test — no blocking issues. Verified against the code: both call sites behave as described (permalink create never migrates the legacy entry so it re-logs indefinitely; get_shared_value persists a migrated sha256 entry so it logs at most once), the ["md5"] fallback default is confirmed, and nothing in-repo keys off this message at WARNING level.

A few optional, non-blocking notes:

  • The log fires on the md5 probe, not on an actual legacy hit. _uuid_namespace_from_md5 (superset/key_value/utils.py:94) logs whenever the md5 namespace is computed, which in the permalink path happens on the unconditional fallback probe (superset/commands/dashboard/permalink/create.py:87-91) before any lookup. So on a stock install every first-time permalink creation emits this even when no md5 data exists, and the message names HASH_ALGORITHM (which is sha256) while the real trigger is HASH_ALGORITHM_FALLBACKS. Pre-existing and arguably out of scope, but since these exact lines are being edited it'd be cheap to fire only on an actual fallback hit and/or reword to name the fallback list.

  • INFO vs DEBUG is a judgment call. The "expected, indefinitely repeating" rationale is close to DEBUG; many deployments run the root logger at INFO, so INFO still adds steady non-actionable volume. INFO is defensible and matches the #42927 precedent — just flagging the alternative.

  • Precedent citation: #43520 isn't merged to master yet (superset/common/query_object.py still uses logger.warning there); the landed WARNING→INFO analogue with the same rationale is #42927 (query_object.py:295-305). Worth citing that instead so the precedent is verifiable.

  • Test: the combined levelno == logging.INFO and "deprecated" in … predicate is airtight against a regression back to warning. Optional: add a negative guard asserting no WARNING-level record for the message to pin intent explicitly.

@eschutho
eschutho merged commit 1fb6b98 into apache:master Sep 7, 2026
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants