这是indexloc提供的服务,不要输入任何密码
Skip to content

Sqlalchemy 2 migration - Fix MyPy type errors in providers #56738

@vincbeck

Description

@vincbeck

Apache Airflow version

3.1.0

If "Other Airflow 2/3 version" selected, which one?

No response

What happened?

Summary

This issue tracks all files currently failing the mypy-providers test. The failures are grouped by directory for easier navigation and fixing.

How to generate the errors

  • Apply changes from Remove SQLA 1 limit in Fab provider #56212 locally
  • Run breeze ci-image build --python 3.10 --upgrade-to-newer-dependencies
  • Run prek --color always --verbose --hook-stage manual "mypy-providers" --all-files reveals numerous type errors throughout the codebase

Current Status (Updated: 2025-01-03)

Total errors found: 19 errors in 9 files (checked 4030 source files)

Error Breakdown by Directory

providers/common/compat/

  • providers/common/compat/src/airflow/providers/common/compat/sqlalchemy/orm.py (1 error)

providers/cncf/kubernetes/

  • providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py (3 errors)

providers/standard/

  • providers/standard/src/airflow/providers/standard/triggers/external_task.py (2 errors)
  • providers/standard/src/airflow/providers/standard/sensors/external_task.py (1 error)

providers/databricks/

  • providers/databricks/src/airflow/providers/databricks/hooks/databricks_base.py (8 errors)
  • providers/databricks/src/airflow/providers/databricks/plugins/databricks_workflow.py (1 error)
  • providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py (1 error)

providers/fab/

  • providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/services/roles.py (2 errors)
  • providers/fab/src/airflow/providers/fab/www/app.py (1 error)

How to Contribute

  1. Pick a file: Choose an unchecked file from the list above
  2. Check the box: Update this issue to mark the file as being worked on
  3. Run MyPy locally: Follow the steps mentioned above to generate the errors. You can also run prek mypy-providers --directory <directory> to run mypy in the directory you are working on
  4. Fix the errors: Address the type errors in your chosen file
  5. Test your changes: Ensure tests still pass
  6. Submit a PR: Create a pull request with your fixes. Please do not include in your PR changes from Remove SQLA 1 limit in Fab provider #56212

Guidelines

  • Focus on one file or directory at a time
  • Follow existing code patterns and conventions

Let's work together to improve Airflow's type safety! 🚀

Note: This issue was generated by running MyPy on the current codebase. The error counts may change as the codebase evolves.

What you think should happen instead?

No response

How to reproduce

  • Apply changes from Remove SQLA 1 limit in Fab provider #56212 locally
  • Run breeze ci-image build --python 3.10 --upgrade-to-newer-dependencies
  • Run prek --color always --verbose --hook-stage manual "mypy-providers" --all-files reveals numerous type errors throughout the codebase

Operating System

Macos

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:providerskind:metaHigh-level information important to the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions