kaxil opened a new pull request, #73605: URL: https://github.com/apache/airflow/pull/73605
The [common.sql connections page](https://airflow.apache.org/docs/apache-airflow-providers-common-sql/stable/connections.html) was two paragraphs that said to pass a connection ID and that other parameters "can be passed as key word args to the operators". Those arguments actually go through `hook_params`. The page also never said that common.sql has no connection type of its own, which is the first thing someone reading it needs to know. The rewrite covers what the operators actually do, all taken from `BaseSQLOperator` and `DbApiHook`: - They reuse a database provider's connection, and the page links to that provider's connection docs. - The hook is resolved from the connection type, and the task fails unless it is a `DbApiHook`. `airflow providers hooks` shows what a type resolves to. - `database` and `hook_params` override settings per task. Connection extras are merged into `hook_params`, and `hook_params` wins on conflict. - A table lists the extras every `DbApiHook` reads (`placeholder`, `dialect`, `sqlalchemy_scheme`, the insert/replace statement formats and the escape settings) with their defaults. These matter most for ODBC and JDBC connections, where the database can't be inferred from the URI. The dialects page had a real bug. It told users to set `dialect_name` in the connection extras, but [`DbApiHook.dialect_name`](https://github.com/apache/airflow/blob/main/providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py#L406) reads the `dialect` key. Anyone who followed the docs got the default dialect with no error. --- * Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged. * For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed. * When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x). * For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
