Skip to content

Fix mypy issues from trinodb 0.337.0#62998

Merged
eladkal merged 2 commits intoapache:mainfrom
eladkal:trino
Mar 6, 2026
Merged

Fix mypy issues from trinodb 0.337.0#62998
eladkal merged 2 commits intoapache:mainfrom
eladkal:trino

Conversation

@eladkal
Copy link
Contributor

@eladkal eladkal commented Mar 6, 2026

Fixing

providers/trino/src/airflow/providers/trino/hooks/trino.py:167: error: Argument 1 to "BasicAuthentication" has incompatible type "str | None"; expected "str"  [arg-type]
                  auth = trino.auth.BasicAuthentication(db.login, db.password)
                                                        ^~~~~~~~
  providers/trino/src/airflow/providers/trino/hooks/trino.py:183: error: Incompatible types in assignment (expression has type "JWTAuthentication", variable has type "BasicAuthentication | None") 
  [assignment]
                  auth = trino.auth.JWTAuthentication(token=token)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  providers/trino/src/airflow/providers/trino/hooks/trino.py:185: error: Incompatible types in assignment (expression has type "CertificateAuthentication", variable has type "BasicAuthentication | None")
   [assignment]
                  auth = trino.auth.CertificateAuthentication(
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  providers/trino/src/airflow/providers/trino/hooks/trino.py:186: error: Argument 1 to "CertificateAuthentication" has incompatible type "Any | None"; expected "str"  [arg-type]
                      extra.get("certs__client_cert_path"),
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  providers/trino/src/airflow/providers/trino/hooks/trino.py:187: error: Argument 2 to "CertificateAuthentication" has incompatible type "Any | None"; expected "str"  [arg-type]
                      extra.get("certs__client_key_path"),
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  providers/trino/src/airflow/providers/trino/hooks/trino.py:190: error: Incompatible types in assignment (expression has type "KerberosAuthentication", variable has type "BasicAuthentication | None") 
  [assignment]
                  auth = trino.auth.KerberosAuthentication(
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  providers/google/src/airflow/providers/google/cloud/transfers/trino_to_gcs.py:74: error: Incompatible return value type (got "list[ColumnDescription]", expected "list[tuple[Any, ...]]")  [return-value]
              return self.cursor.description
                     ^~~~~~~~~~~~~~~~~~~~~~~
  providers/google/src/airflow/providers/google/cloud/transfers/trino_to_gcs.py:74: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
  providers/google/src/airflow/providers/google/cloud/transfers/trino_to_gcs.py:74: note: Consider using "Sequence" instead, which is covariant
  Found 7 errors in 2 files (checked 4242 source files)

@eladkal eladkal requested a review from shahar1 as a code owner March 6, 2026 15:21
@boring-cyborg boring-cyborg bot added area:providers provider:google Google (including GCP) related issues provider:trino labels Mar 6, 2026
@eladkal eladkal requested a review from potiuk March 6, 2026 15:21
@potiuk
Copy link
Member

potiuk commented Mar 6, 2026

Needs more fixes :(

@eladkal eladkal merged commit e96907b into apache:main Mar 6, 2026
88 checks passed
@eladkal eladkal deleted the trino branch March 6, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:google Google (including GCP) related issues provider:trino

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants