sqlalchemy-trino icon indicating copy to clipboard operation
sqlalchemy-trino copied to clipboard

Add support for args/params for extraCredentials to be passed via headers to trino

Open matt12eagles opened this issue 3 years ago • 3 comments

Add support for args/params for extraCredentials to be passed via headers to trino

Thinking this link may be of use:

https://github.com/dropbox/PyHive/issues/311#issuecomment-586828649

matt12eagles avatar Oct 12 '21 19:10 matt12eagles

+1 on this. It would be even better if we can pass in arbitrary headers. For our use case, the Host header is needed.

mapshen avatar Oct 15 '21 01:10 mapshen

Hello @matt12eagles, @mapshen Did you try:

engine = create_engine(...,
   connect_args=dict(
    http_headers={
      'X-Presto-Extra-Credential': f"access-token={ACCESS_TOKEN}"
    },
  )
)
``

dungdm93 avatar Nov 25 '21 07:11 dungdm93

@dungdm93 I can confirm this setting does take effect - is there a doc on the args users can pass into connect_args?

mapshen avatar Dec 21 '21 20:12 mapshen