Skip to content

fix(tags): fix broken import in daos/tag.py - #43466

Merged
rusackas merged 1 commit into
masterfrom
fix/daos-tag-broken-import
Aug 24, 2026
Merged

rusackas merged 1 commit into
masterfrom
fix/daos-tag-broken-import

Conversation

@rusackas

Copy link
Copy Markdown
Member

SUMMARY

superset/daos/tag.py imports current_user_can_modify_object from superset.commands.tag.utils, but that function was relocated to superset.commands.utils in #43389, which merged shortly after #43390 added this import. Neither PR could see the other's in-flight change, and there was no textual conflict, so both merged clean. The result: daos/tag.py (and everything importing it, including chart/dataset/etc. REST APIs) fails at import time on current master.

The fix re-points the import at its new home. It's done as a lazy, function-local import rather than a top-level one, since superset.commands.utils itself imports TagDAO from superset.daos.tag — a top-level import in both directions would be circular.

Also updates two existing tests in tests/unit_tests/tags/commands/update_test.py that patched the old module-level attribute (superset.daos.tag.current_user_can_modify_object); with the import now local to the function, the patch target moves to where the function actually lives (superset.commands.utils.current_user_can_modify_object).

TESTING INSTRUCTIONS

pytest tests/unit_tests/tags/ tests/unit_tests/commands/ tests/unit_tests/semantic_layers/ tests/unit_tests/daos/ — 1474 passed. Also verified create_app() completes without the prior ImportError (confirmed the error reproduces on master before this fix, and is gone after).

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

current_user_can_modify_object moved out of superset.commands.tag.utils,
but daos/tag.py's own import wasn't updated, breaking app boot (ChartRestApi
et al. import this module transitively). Re-point the import at its new
location, lazily inside the function to avoid a circular import between
daos.tag and commands.utils (the latter imports TagDAO from the former).
@dosubot dosubot Bot added the change:backend Requires changing the backend label Aug 24, 2026
@rusackas
rusackas requested a review from sadpandajoe August 24, 2026 16:11
@rusackas rusackas added the merge-if-green If approved and tests are green, please go ahead and merge it for me label Aug 24, 2026
@rusackas
rusackas requested review from sha174n and villebro August 24, 2026 16:11
@bito-code-review

bito-code-review Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #3b3d0f

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 0e36851..0e36851
    • superset/daos/tag.py
    • tests/unit_tests/tags/commands/update_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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@codecov

codecov Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.87%. Comparing base (7f1b414) to head (0e36851).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #43466    +/-   ##
========================================
  Coverage   78.86%   78.87%            
========================================
  Files        2876     2877     +1     
  Lines      164623   164853   +230     
  Branches    38019    38063    +44     
========================================
+ Hits       129835   130031   +196     
- Misses      32345    32372    +27     
- Partials     2443     2450     +7     
Flag Coverage Δ
hive 38.05% <50.00%> (-0.04%) ⬇️
mysql 57.80% <100.00%> (-0.02%) ⬇️
postgres 57.83% <100.00%> (-0.02%) ⬇️
presto 39.97% <50.00%> (-0.04%) ⬇️
python 83.57% <100.00%> (+0.01%) ⬆️
sqlite 57.53% <100.00%> (-0.02%) ⬇️
unit 73.61% <100.00%> (+0.03%) ⬆️

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.

@rusackas
rusackas merged commit f3142e7 into master Aug 24, 2026
84 checks passed
@rusackas
rusackas deleted the fix/daos-tag-broken-import branch August 24, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:backend Requires changing the backend merge-if-green If approved and tests are green, please go ahead and merge it for me preset-io size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants