This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new e4ae83d488 Use startswith once with a tuple in Hive hook (#33765)
e4ae83d488 is described below

commit e4ae83d488bd0bc4554f400c2c1c2d3fc1c44fd6
Author: Hussein Awala <[email protected]>
AuthorDate: Sat Aug 26 09:19:03 2023 +0200

    Use startswith once with a tuple in Hive hook (#33765)
---
 airflow/providers/apache/hive/hooks/hive.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/airflow/providers/apache/hive/hooks/hive.py 
b/airflow/providers/apache/hive/hooks/hive.py
index 7f02619024..5b0c91083a 100644
--- a/airflow/providers/apache/hive/hooks/hive.py
+++ b/airflow/providers/apache/hive/hooks/hive.py
@@ -907,11 +907,8 @@ class HiveServer2Hook(DbApiHook):
                 cur.execute(statement)
                 # we only get results of statements that returns
                 lowered_statement = statement.lower().strip()
-                if (
-                    lowered_statement.startswith("select")
-                    or lowered_statement.startswith("with")
-                    or lowered_statement.startswith("show")
-                    or (lowered_statement.startswith("set") and "=" not in 
lowered_statement)
+                if lowered_statement.startswith(("select", "with", "show")) or 
(
+                    lowered_statement.startswith("set") and "=" not in 
lowered_statement
                 ):
                     description = cur.description
                     if previous_description and previous_description != 
description:

Reply via email to