Skip to content

Use built-in exceptions for Postgres hook input validation - #70537

Open
mitre88 wants to merge 1 commit into
apache:mainfrom
mitre88:narrow-postgres-hook-exceptions
Open

Use built-in exceptions for Postgres hook input validation#70537
mitre88 wants to merge 1 commit into
apache:mainfrom
mitre88:narrow-postgres-hook-exceptions

Conversation

@mitre88

@mitre88 mitre88 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Part of the ongoing clean-up of broad AirflowException usages (enforced by the check-no-new-airflow-exceptions ratchet), following the pattern of #66279.

PostgresHook raised AirflowException for two input-validation failures: a sqlalchemy_query connection extra that is not a dict (now TypeError), and requesting realdictcursor with psycopg3 (now ValueError, matching the invalid-cursor branch immediately below it that already raises ValueError). The known_airflow_exceptions.txt entry for the file drops from 2 to 0, and the existing test now asserts the specific exception type and message.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5)

Generated-by: Claude Code (Fable 5) following the guidelines

A wrong type for sqlalchemy_query is a TypeError, and requesting the
psycopg3-unsupported realdictcursor is a ValueError like the invalid
cursor branch right next to it; both were raised as the broad
AirflowException the community is actively reducing. Follows the
clean-up pattern of apache#66279.
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants