From 0b941f74812baa25fca8b2e34ba3431d39ab1158 Mon Sep 17 00:00:00 2001 From: Duyet Le Date: Tue, 24 Oct 2023 14:47:36 +0700 Subject: [PATCH] feat(trino): support config timezone --- airflow/providers/trino/hooks/trino.py | 1 + docs/apache-airflow-providers-trino/connections.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/airflow/providers/trino/hooks/trino.py b/airflow/providers/trino/hooks/trino.py index aaa77a45bc345..d64ec02f99d3d 100644 --- a/airflow/providers/trino/hooks/trino.py +++ b/airflow/providers/trino/hooks/trino.py @@ -145,6 +145,7 @@ def get_conn(self) -> Connection: verify=_boolify(extra.get("verify", True)), session_properties=extra.get("session_properties") or None, client_tags=extra.get("client_tags") or None, + timezone=extra.get("timezone") or None, ) return trino_conn diff --git a/docs/apache-airflow-providers-trino/connections.rst b/docs/apache-airflow-providers-trino/connections.rst index ee25fbbce7183..7cb5ce928439d 100644 --- a/docs/apache-airflow-providers-trino/connections.rst +++ b/docs/apache-airflow-providers-trino/connections.rst @@ -54,5 +54,6 @@ Extra (optional, connection parameters) * ``kerberos__service_name``, ``kerberos__config``, ``kerberos__mutual_authentication``, ``kerberos__force_preemptive``, ``kerberos__hostname_override``, ``kerberos__sanitize_mutual_error_response``, ``kerberos__principal``,``kerberos__delegate``, ``kerberos__ca_bundle`` - These parameters can be set when enabling ``kerberos`` authentication. * ``session_properties`` - JSON dictionary which allows to set session_properties. Example: ``{'session_properties':{'scale_writers':true,'task_writer_count:1'}}`` * ``client_tags`` - List of comma separated tags. Example ``{'client_tags':['sales','cluster1']}``` + * ``timezone`` - The time zone for the session can be explicitly set using the IANA time zone name. Example ``{'timezone':'Asia/Ho_Chi_Minh'}``. Note: If ``jwt__file`` and ``jwt__token`` are both given, ``jwt__file`` will take precedent.