Skip to content

ExasolHook logs SQL after execution #48246

@XtremeBaumer

Description

@XtremeBaumer

Apache Airflow Provider(s)

exasol

Versions of Apache Airflow Providers

apache-airflow-providers-exasol = "4.7.3"

Apache Airflow version

2.10.5

Operating System

Debian GNU/Linux 11 (bullseye)

Deployment

Virtualenv installation

Deployment details

No response

What happened

Whenever a long-running query is ran using the ExasolHook, it looks like the task is stuck, because it is missing the corresponding log. In my opinion it is more user-friendly to first log the SQL before it is actually executed

What you think should happen instead

The SQL query should be logged before it is executed

How to reproduce

Execute any long-running query using ExasolHook

long_running_statement = "..."
hook = ExasolHook()
hook.run(long_running_statement)

Anything else

The issue happens everytime and is still prevalent in the most recent version. The lines that needs to be swapped (logging before with-statement):

with closing(conn.execute(sql_statement, parameters)) as exa_statement:
    self.log.info("Running statement: %s, parameters: %s", sql_statement, parameters)

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions