Skip to content

Add support for semicolon stripping to DbApiHook, PrestoHook, and TrinoHook - #41916

Merged
potiuk merged 18 commits into
apache:mainfrom
Illumaria:main
Nov 13, 2024
Merged

Add support for semicolon stripping to DbApiHook, PrestoHook, and TrinoHook#41916
potiuk merged 18 commits into
apache:mainfrom
Illumaria:main

Conversation

@Illumaria

@IllumariaIllumaria commented Aug 31, 2024

Copy link
Copy Markdown
Contributor

Closes: #34828

@boring-cyborg

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@Illumaria
Illumaria marked this pull request as ready for review August 31, 2024 12:57
@potiuk

Copy link
Copy Markdown
Member

You will have to:

  1. bump common.sql minor version (new feature) in airfow/providers/common/sql/provider.yaml
  2. In all modified providers you will have to update dependency in provider yaml to be: common-sql >= THE(_NEW_COMMON_SQL_VERSION

@Illumaria

Copy link
Copy Markdown
ContributorAuthor

Whoops... Sorry. 🙏🏻

Comment threadairflow/providers/common/sql/provider.yaml Outdated
Comment threadairflow/providers/presto/provider.yaml Outdated
@eladkal

Copy link
Copy Markdown
Contributor

@Illumaria can you address the needed changes? I'm hoping to include this PR in the next release

Comment threadairflow/providers/common/sql/provider.yaml Outdated
Comment threadairflow/providers/presto/provider.yaml Outdated
Comment threadairflow/providers/trino/provider.yaml Outdated
Comment threadgenerated/provider_dependencies.json Outdated
Comment threadgenerated/provider_dependencies.json Outdated
@eladkal

Copy link
Copy Markdown
Contributor

needs rebase and resolve conflicts

@Illumaria

Copy link
Copy Markdown
ContributorAuthor

@eladkal Sure, I’ll do it by the end of the weekend.

@potiuk

Copy link
Copy Markdown
Member

Rebased after merging #43913

@eladkal

eladkal commented Nov 12, 2024

Copy link
Copy Markdown
Contributor

OK @Illumaria I think we sort out all the issues related to breeze testing. We now see failures which seems related to the PR itself for the back compat tests with Airflow 2.8 can you take a look?

=========================== short test summary info ============================
FAILED providers/tests/google/cloud/openlineage/test_mixins.py::TestBigQueryOpenLineageMixin::test_bq_job_information - TypeError: split() got an unexpected keyword argument 'strip_semicolon'
FAILED providers/tests/google/cloud/openlineage/test_mixins.py::TestBigQueryOpenLineageMixin::test_bq_script_job_information - TypeError: split() got an unexpected keyword argument 'strip_semicolon'
FAILED providers/tests/google/cloud/operators/test_bigquery.py::TestBigQueryInsertJobOperator::test_execute_openlineage_events - TypeError: split() got an unexpected keyword argument 'strip_semicolon'
FAILED providers/tests/google/cloud/operators/test_bigquery.py::TestBigQueryInsertJobOperator::test_execute_fails_openlineage_events - TypeError: split() got an unexpected keyword argument 'strip_semicolon'
====== 4 failed, 4199 passed, 79 skipped, 1 warning in 261.82s (0:04:21) =======

The above test failures are due to using sqlparser<0.5 so our lower dependency tests have successfully found that we need to bump sqlparser to use the strip_semicolon parameter.

@Illumaria

Illumaria commented Nov 13, 2024

Copy link
Copy Markdown
ContributorAuthor

Uhm... Is this a network issue on GitHub side? O_o
https://github.com/apache/airflow/actions/runs/11816640286/job/32920825020?pr=41916#step:2:13

Run docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
Unable to find image 'bash:latest' locally
docker: Error response from daemon: Head "https://registry-1.docker.io/v2/library/bash/manifests/latest": Get "https://auth.docker.io/token?account=githubactions&scope=repository%3Alibrary%2Fbash%3Apull&service=registry.docker.io": net/http: request canceled (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.
Error: Process completed with exit code 125.

@potiuk

Copy link
Copy Markdown
Member

Uhm... Is this a network issue on GitHub side? O_o

Yeah.... Happens

@potiuk

potiuk commented Nov 13, 2024

Copy link
Copy Markdown
Member

We (committers) can re-start that one failed job later after this PR completes all other checks.

@Illumaria

Copy link
Copy Markdown
ContributorAuthor

@potiuk Could you please re-run the failed test job? I don't think I have the rights.

@potiukpotiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE! finally!

@potiuk
potiuk merged commit e7194df into apache:mainNov 13, 2024
@boring-cyborg

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@potiuk

Copy link
Copy Markdown
Member

Wooooohooo! (CC: @eladkal )

@potiuk

Copy link
Copy Markdown
Member

Thanks @Illumaria for the patience. It was not an easy one and it uncovered a number of edge-cases in our CI that we had to fix :)

#protm

@eladkal

Copy link
Copy Markdown
Contributor

Great work @Illumaria 👏🏻👏🏻

ellisms pushed a commit to ellisms/airflow that referenced this pull request Nov 13, 2024
…noHook (apache#41916)
---------
Co-authored-by: Elad Kalif <45845474+eladkal@users.noreply.github.com>
amoghrajesh pushed a commit to astronomer/airflow that referenced this pull request Nov 14, 2024
…noHook (apache#41916)
---------
Co-authored-by: Elad Kalif <45845474+eladkal@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providersfull tests neededWe need to run full set of tests for this PR to mergeprovider:common-sqlprovider:presto

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trino SQL split trailing semi-colon

5 participants

@Illumaria@potiuk@eladkal@mobuchowski@vgvoleg