Skip to content

Commit

Permalink
Use startswith once with a tuple in Hive hook (#33765)
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-awala committed Aug 26, 2023
1 parent 4e545c8 commit e4ae83d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions airflow/providers/apache/hive/hooks/hive.py
Expand Up @@ -907,11 +907,8 @@ def _get_results(
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:
Expand Down

0 comments on commit e4ae83d

Please sign in to comment.