Skip to content

Fix cursor unique name surpasses Postgres identifier limit in PostgresToGCSOperator - #38040

Merged
Taragolis merged 2 commits into
apache:mainfrom
dybolo:postgres_to_gcs_unique_name
Mar 19, 2024
Merged

Taragolis merged 2 commits into
apache:mainfrom
dybolo:postgres_to_gcs_unique_name

Conversation

@dybolo

@dybolo dybolo commented Mar 11, 2024

Copy link
Copy Markdown
Contributor

closes: #37654

The function unique_name now generates UUID from the SHA-1 hash using the dag id and the task id. The previous version of the function throwed unterminated quoted identifier error when the operator was used with a task_id greater than 24 bytes as the name generated surpassed the postgres identifier limit.

@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Mar 11, 2024
@boring-cyborg

boring-cyborg Bot commented Mar 11, 2024

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

@eladkal eladkal changed the title Fix #37654: postgres_to_gcs cursor unique name surpasses postgres identifier limit Fix cursor unique name surpasses Postgres identifier limit in PostgresToGCSOperator Mar 11, 2024
Comment thread tests/providers/google/cloud/transfers/test_postgres_to_gcs.py Outdated
Comment thread airflow/providers/google/cloud/transfers/postgres_to_gcs.py Outdated
@dybolo
dybolo force-pushed the postgres_to_gcs_unique_name branch 2 times, most recently from affa9e4 to 9d98548 Compare March 16, 2024 21:57
dybolo added 2 commits March 19, 2024 15:43
…es identifier limit

function unique_name generates UUID from the SHA-1 hash using the dag id and the task id. The previous version of the function throwed unterminated quoted identifier error when the operator was used with a task_id greater than 24 bytes as the name generated surpassed the postgres identifier limit.
… to non-deterministic and utilized slugify to ensure compliance with length limits
@potiuk
potiuk force-pushed the postgres_to_gcs_unique_name branch from 9d98548 to 7864135 Compare March 19, 2024 14:43
@potiuk

potiuk commented Mar 19, 2024

Copy link
Copy Markdown
Member

@Taragolis ?

@Taragolis
Taragolis merged commit e0feb7b into apache:main Mar 19, 2024
@boring-cyborg

boring-cyborg Bot commented Mar 19, 2024

Copy link
Copy Markdown

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

@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostgresToGCSOperator with server_side_cursor use unique_name that breaks postgres identifier limit

5 participants