starburstdata/dbt-trino

`dbt/adapters/trino/connections.py` calls `trino.auth.CertificateAuthentication` with incorrect named parameters when upgrading to version 1.2.2

KateShopify opened this issue · 0 comments

Expected behavior

Syntax error found on line 133 in dbt/adapters/trino/connections.py when upgrading to version 1.2.2

Instantiating a trino.auth.CertificateAuthentication object from trino-python-client should use the named parameters cert and key. Or it can be instantiated with no named parameters.

Proper usage:

 trino.auth.CertificateAuthentication(
            cert=self.client_certificate,
            key=self.client_private_key
       )

Actual behavior

trino.auth.CertificateAuthentication was instantiated with named parameters client_certificate and client_private_key. Which produced this error: __init__() got an unexpected keyword argument 'client_certificate'

    def trino_auth(self):
        return trino.auth.CertificateAuthentication(
            client_certificate=self.client_certificate,
            client_private_key=self.client_private_key,
        )

Steps To Reproduce

Creating auth using certificate authentication

auth = trino.auth.CertificateAuthentication(cert=<cert_path>, key=<key_path>)
self.cursor = trino.dbapi.connect(
...
 ).cursor()

Error observed when running model
DBT.run(my_first_dbt_model, engine='trino' .... )

Log output/Screenshots

File "/app/venv/dbt/lib/python3.9/site-packages/dbt/adapters/trino/connections.py", line 358, in exception_handler
--
  | raise dbt.exceptions.RuntimeException(str(exc))
  | dbt.exceptions.RuntimeException: Runtime Error
  | __init__() got an unexpected keyword argument 'client_certificate'

Operating System

MacOS 12.6

dbt version

1.2.2

Trino Server version

1.2.2

Python version

3.9.10

Are you willing to submit PR?

  • Yes I am willing to submit a PR!