You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "anmolxlight (via GitHub)" <gi...@apache.org> on 2026/06/06 22:29:54 UTC

[PR] Add Cloud SQL no-operation sensor [airflow]

anmolxlight opened a new pull request, #68146:
URL: https://github.com/apache/airflow/pull/68146

   Add a deferrable `CloudSQLNoOperationInProgressSensor` for waiting until a Cloud SQL instance has no non-terminal operation in progress.
   
   This gives DAG authors an explicit provider primitive to avoid `operationInProgress` 409s before submitting import, export, clone, patch, or other Cloud SQL administrative operations.
   
   Changes:
   - add sync and async Cloud SQL operation-list helpers
   - add `CloudSQLNoOperationInProgressSensor`
   - add `CloudSQLNoOperationInProgressTrigger`
   - register the new sensor in the Google provider metadata
   - document the sensor in the Cloud SQL how-to guide and system test example
   - add unit coverage for the hook helper, sensor, and trigger
   
   Closes: #68040
   
   Tests:
   - `uv run pytest --with-db-init providers/google/tests/unit/google/cloud/sensors/test_cloud_sql.py providers/google/tests/unit/google/cloud/triggers/test_cloud_sql_no_operation.py providers/google/tests/unit/google/cloud/hooks/test_cloud_sql.py -q`
   - `uv run ruff check providers/google/src/airflow/providers/google/cloud/hooks/cloud_sql.py providers/google/src/airflow/providers/google/cloud/triggers/cloud_sql.py providers/google/src/airflow/providers/google/cloud/sensors/cloud_sql.py providers/google/tests/system/google/cloud/cloud_sql/example_cloud_sql.py providers/google/tests/unit/google/cloud/hooks/test_cloud_sql.py providers/google/tests/unit/google/cloud/sensors/test_cloud_sql.py providers/google/tests/unit/google/cloud/triggers/test_cloud_sql_no_operation.py`
   - `uv run ruff format --check providers/google/src/airflow/providers/google/cloud/hooks/cloud_sql.py providers/google/src/airflow/providers/google/cloud/triggers/cloud_sql.py providers/google/src/airflow/providers/google/cloud/sensors/cloud_sql.py providers/google/tests/system/google/cloud/cloud_sql/example_cloud_sql.py providers/google/tests/unit/google/cloud/hooks/test_cloud_sql.py providers/google/tests/unit/google/cloud/sensors/test_cloud_sql.py providers/google/tests/unit/google/cloud/triggers/test_cloud_sql_no_operation.py`
   - `PYTHONPATH=scripts/ci/prek uv run --script scripts/ci/prek/check_trigger_serialize_init.py providers/google/src/airflow/providers/google/cloud/triggers/cloud_sql.py`
   - `uv run --script scripts/ci/prek/check_deferrable_default.py`
   - `uv run prek run --config .pre-commit-config.yaml --files generated/provider_dependencies.json.sha256sum providers/google/docs/operators/cloud/cloud_sql.rst providers/google/provider.yaml providers/google/src/airflow/providers/google/cloud/hooks/cloud_sql.py providers/google/src/airflow/providers/google/cloud/triggers/cloud_sql.py providers/google/src/airflow/providers/google/cloud/sensors/cloud_sql.py providers/google/tests/system/google/cloud/cloud_sql/example_cloud_sql.py providers/google/tests/unit/google/cloud/hooks/test_cloud_sql.py providers/google/tests/unit/google/cloud/sensors/test_cloud_sql.py providers/google/tests/unit/google/cloud/triggers/test_cloud_sql_no_operation.py`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Cloud SQL no-operation sensor [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #68146:
URL: https://github.com/apache/airflow/pull/68146#issuecomment-5147177765

   Thank you for this, and I'm sorry it's taken eight weeks to get you an answer.
   
   #68151 proposes the same feature — same `CloudSQLNoOperationInProgressSensor`, same `CloudSQLNoOperationInProgressTrigger`, near-identical file set — and was opened a day after yours. Two people built the same primitive in parallel and neither got reviewed, which is a failure of our process rather than of either contribution. I've merged #68151 and am closing this one.
   
   To be straight about why, since "the other one won" is not a useful answer:
   
   - **Mergeability.** #68151 is currently mergeable; this branch is ~1042 commits behind `main` and conflicting, so landing it would have meant a substantial rebase of a 590-line feature.
   - **Shared status constant.** #68151 factors `CLOUD_SQL_NON_TERMINAL_STATUSES` into the hook so the sensor and trigger share one definition.
   - **Test placement.** Its trigger tests extend `tests/.../triggers/test_cloud_sql.py`, mirroring `triggers/cloud_sql.py`; this PR adds `test_cloud_sql_no_operation.py`, which doesn't follow the test-location convention.
   
   Your version was ahead on one point I want on record: it introduces **no** `AirflowException` usage at all. #68151 defines a `CloudSQLOperationError(AirflowException)` subclass — acceptable under the project's guidance, but yours avoided the base class entirely.
   
   One thing to check on your side for future PRs: this branch modifies `generated/provider_dependencies.json.sha256sum`, a generated checksum that shouldn't normally be hand-edited in a feature PR — worth confirming that wasn't an accidental inclusion.
   
   None of this reflects on the quality of your work. If you'd like to stay involved, a review on #68151 would be genuinely welcome — you know this problem space as well as anyone — and checking `gh pr list --search "<feature>"` before starting will stop this happening again.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Cloud SQL no-operation sensor [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed pull request #68146: Add Cloud SQL no-operation sensor
URL: https://github.com/apache/airflow/pull/68146


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org