potiuk commented on PR #45690: URL: https://github.com/apache/airflow/pull/45690#issuecomment-2595051640
> That Bedrock one was on me. I thought I was just saving a bunch of repetition and didn't realize the impact of that small change. Well spotted, and thanks for fixing it. As part of "clearing the path" - here is https://github.com/apache/airflow/pull/45704 as a follow up to prevent it in the future. With one caveat .... the test would not have caught the error in this case because `aws_conn_id` was set to None, so actually ... get_connection() was not called. But I think that's something we cannot actually easily prevent, but it's a bit of bad practice to set aws_conn_id for "example_dags" - because it makes it ... bad example , and not good candidates to run as system tests. The added test will make it quite obvious though: when someone adds example_dag with `get_connection` retrieval, the error will be: ``` f"BaseHook.get_connection() should not be called during DAG parsing. " f"It was called {mock_get_connection.call_count} times. Please make sure that no " "connections are created during DAG parsing. NOTE! Do not set conn_id to None to avoid it, just make " "sure that you do not create connection object in the `__init__` method of your operator." ``` I hope this will be helpful to avoid such mistake in the future :) -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org