Skip to content

Show clear error for invalid sql_alchemy_conn at startup#69878

Open
GayathriSrividya wants to merge 1 commit into
apache:mainfrom
GayathriSrividya:fix/invalid-sqlalchemy-uri-help-cli-68707
Open

Show clear error for invalid sql_alchemy_conn at startup#69878
GayathriSrividya wants to merge 1 commit into
apache:mainfrom
GayathriSrividya:fix/invalid-sqlalchemy-uri-help-cli-68707

Conversation

@GayathriSrividya

Copy link
Copy Markdown
Contributor

closes: #68707

Use this PR description:

Title:
Show clear error for invalid sql_alchemy_conn at startup

Body:

Summary

This PR improves startup error handling when database.sql_alchemy_conn is invalid.

Changes included:

  1. Added validation in settings URI conversion so malformed connection URIs fail with a clear, actionable ValueError.
  2. Error message now points users to both AIRFLOW__DATABASE__SQL_ALCHEMY_CONN and sql_alchemy_conn in airflow.cfg.
  3. Refactored URI-conversion tests into parametrized cases for supported schemes and invalid inputs.
  4. Kept PostgreSQL test expectations compatible with the active async driver selection (psycopg_async vs asyncpg).

Why

Previously, malformed SQLAlchemy connection URIs could fail in a less clear way during startup. This makes failures easier to diagnose and faster to fix.

Testing

  1. Updated unit tests in airflow-core tests for settings URI conversion.
  2. Ruff format/check run on modified files.
  3. Local targeted pytest via uv was blocked by a provider import issue in this environment; changes are covered by updated unit tests and will be validated in CI.

Reviewer

Requested reviewer: @justinpakzad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant