Skip to content

Conversation

@aminghadersohi
Copy link
Contributor

@aminghadersohi aminghadersohi commented Jan 5, 2026

User description

Summary

When superset-core is installed as an editable dependency locally (via apache-superset-core = { path = "./superset-core", editable = true }), mypy can see its type information and flags # type: ignore comments as unused. In CI, the types aren't exposed the same way, so those comments are still needed.

This adds mypy overrides to:

  1. Skip following imports from superset_core module
  2. Disable warn_unused_ignores for modules with dynamic type assignments that need # type: ignore in CI

Affected modules:

  • superset.core.api.core_api_injection
  • superset.security.manager
  • superset.daos.base
  • superset.connectors.sqla.models
  • superset.tags.filters
  • superset.commands.security.update
  • superset.commands.security.create

Before/After

Before: Local pre-commit mypy fails with 26 "Unused type: ignore comment" errors
After: Local pre-commit mypy passes, matching CI behavior

Test Plan

  • Verified pre-commit run mypy --files superset/core/api/core_api_injection.py passes locally
  • Verified all previously failing files pass mypy locally
  • CI should continue to pass (no behavioral change in CI)

Additional Information

This issue started appearing for developers with local editable installs of superset-core after the superset-core package was introduced. The fix ensures consistent behavior between local development and CI environments.

🤖 Generated with Claude Code


CodeAnt-AI Description

Add mypy overrides so local checks match CI when superset-core is editable

What Changed

  • Ignore following imports from the superset_core package during local mypy runs so editable local installs don't surface CI-only type differences
  • Disable "warn_unused_ignores" for seven modules that rely on type: ignore comments in CI to avoid spurious local failures

Impact

✅ Fewer local mypy failures during pre-commit
✅ Consistent mypy results between local development and CI
✅ Shorter developer setup time when using an editable superset-core

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

When superset-core is installed as an editable dependency locally,
mypy can see its type information and flags type: ignore comments
as unused. In CI, the types aren't exposed the same way, so those
comments are still needed.

This adds mypy overrides to:
1. Skip following imports from superset_core module
2. Disable warn_unused_ignores for modules with dynamic type
   assignments that need type: ignore in CI

Fixes local pre-commit mypy failures that don't occur in CI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 5, 2026

Code Review Agent Run #7cabc2

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 3c414a7..3c414a7
    • pyproject.toml
  • Files skipped - 0
  • Tools
    • 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 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

@dosubot dosubot bot added the change:backend Requires changing the backend label Jan 5, 2026
@codeant-ai-for-open-source codeant-ai-for-open-source bot added the size:S This PR changes 10-29 lines, ignoring generated files label Jan 5, 2026
@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI finished reviewing your PR.

@codeant-ai-for-open-source
Copy link
Contributor

💡 Enhance Your PR Reviews

We noticed that 3 feature(s) are not configured for this repository. Enabling these features can help improve your code quality and workflow:

🚦 Quality Gates

Status: Quality Gates are not enabled at the organization level
Learn more about Quality Gates

🎫 Jira Ticket Compliance

Status: Jira credentials file not found. Please configure Jira integration in your settings
Learn more about Jira Integration

⚙️ Custom Rules

Status: No custom rules configured. Add rules via organization settings or .codeant/review.json in your repository
Learn more about Custom Rules


Want to enable these features? Contact your organization admin or check our documentation for setup instructions.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds mypy configuration overrides to ensure consistent behavior between local development (where superset-core is installed as an editable dependency) and CI environments (where type information from superset-core may not be exposed the same way).

Key Changes:

  • Added mypy override to skip following imports from superset_core.* module
  • Disabled warn_unused_ignores for seven modules that perform dynamic type assignments and require # type: ignore comments for CI compatibility

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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 size/S size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant