amoghrajesh commented on PR #52876: URL: https://github.com/apache/airflow/pull/52876#issuecomment-3052205097
@ephraimbuddy good news. The issue I had earlier seems to be fixed with your PR. I checked out to your PR, made the following changes: ``` diff --git a/task-sdk/src/airflow/sdk/bases/hook.py b/task-sdk/src/airflow/sdk/bases/hook.py index 349fb150c6..7f37e648ea 100644 --- a/task-sdk/src/airflow/sdk/bases/hook.py +++ b/task-sdk/src/airflow/sdk/bases/hook.py @@ -59,17 +59,17 @@ class BaseHook(LoggingMixin): import sys # if SUPERVISOR_COMMS is set, we're in task sdk context - if hasattr(sys.modules.get("airflow.sdk.execution_time.task_runner"), "SUPERVISOR_COMMS"): - from airflow.sdk.definitions.connection import Connection + # if hasattr(sys.modules.get("airflow.sdk.execution_time.task_runner"), "SUPERVISOR_COMMS"): + from airflow.sdk.definitions.connection import Connection - conn = Connection.get(conn_id) - log.info("Connection Retrieved '%s' (via task-sdk)", conn.conn_id) - return conn - from airflow.models.connection import Connection as ConnectionModel - - conn = ConnectionModel.get_connection_from_secrets(conn_id) - log.info("Connection Retrieved '%s' (via core Airflow)", conn.conn_id) + conn = Connection.get(conn_id) + log.info("Connection Retrieved '%s' (via task-sdk)", conn.conn_id) return conn + # from airflow.models.connection import Connection as ConnectionModel + # + # conn = ConnectionModel.get_connection_from_secrets(conn_id) + # log.info("Connection Retrieved '%s' (via core Airflow)", conn.conn_id) + # return conn ``` And ran the test: `test_return_correct_results_with_order_by` due to which I had reported this error. Seems to work as expected: ``` Skipping initializing of the DB as it was initialized already. You can re-initialize the database by adding --with-db-init flag when running tests. [2025-07-09T16:29:23.173+0530] {secrets_masker.py:357} WARNING - Skipping masking for a secret as it's too short (<5 chars) [2025-07-09T16:29:23.182+0530] {dagbag.py:620} INFO - Filling up the DagBag from /dev/null [2025-07-09T16:29:23.206+0530] {collection.py:83} INFO - Creating ORM DAG for test_dag1 [2025-07-09T16:29:23.499+0530] {collection.py:83} INFO - Creating ORM DAG for test_dag2 [2025-07-09T16:29:23.527+0530] {manager.py:172} INFO - DAG bundles loaded: dag_maker, another_bundle_name, example_dags 2025-07-09 16:29:23 [debug ] bundle configured bare_repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/dag_maker/bare') bundle_name=dag_maker git_conn_id=None repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/dag_maker/tracking_repo') version=None versions_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/dag_maker/versions') 2025-07-09 16:29:23 [debug ] Neither git_conn_id nor repo_url provided; loading 'git_default' bare_repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/dag_maker/bare') bundle_name=dag_maker git_conn_id=None repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/dag_maker/tracking_repo') version=None versions_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/dag_maker/versions') 2025-07-09 16:29:23 [debug ] repo_url updated from hook bare_repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/dag_maker/bare') bundle_name=dag_maker git_conn_id=None repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/dag_maker/tracking_repo') version=None versions_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/dag_maker/versions') 2025-07-09 16:29:23 [debug ] bundle configured bare_repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/another_bundle_name/bare') bundle_name=another_bundle_name git_conn_id=None repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/another_bundle_name/tracking_repo') version=None versions_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/another_bundle_name/versions') 2025-07-09 16:29:23 [debug ] Neither git_conn_id nor repo_url provided; loading 'git_default' bare_repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/another_bundle_name/bare') bundle_name=another_bundle_name git_conn_id=None repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/another_bundle_name/tracking_repo') version=None versions_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/another_bundle_name/versions') 2025-07-09 16:29:23 [debug ] repo_url updated from hook bare_repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/another_bundle_name/bare') bundle_name=another_bundle_name git_conn_id=None repo_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/another_bundle_name/tracking_repo') version=None versions_path=PosixPath('/var/folders/ww/wv3dswrd0hj2jymcq20l70nc0000gn/T/airflow/dag_bundles/another_bundle_name/versions') [2025-07-09T16:29:23.528+0530] {manager.py:216} INFO - Added new DAG bundle another_bundle_name to the database [2025-07-09T16:29:23.528+0530] {manager.py:216} INFO - Added new DAG bundle example_dags to the database PASSED [ 10%][2025-07-09T16:29:24.262+0530] {_client.py:1026} INFO - HTTP Request: GET http://testserver/api/v2/dags/test_dag1/dagRuns?order_by=id "HTTP/1.1 200 OK" [2025-07-09T16:29:24.272+0530] {_client.py:1026} INFO - HTTP Request: GET http://testserver/api/v2/dags/test_dag1/dagRuns?order_by=-id "HTTP/1.1 200 OK" [2025-07-09T16:29:24.279+0530] {dagbag.py:620} INFO - Filling up the DagBag from /dev/null [2025-07-09T16:29:24.286+0530] {collection.py:83} INFO - Creating ORM DAG for test_dag1 [2025-07-09T16:29:24.311+0530] {collection.py:83} INFO - Creating ORM DAG for test_dag2 [2025-07-09T16:29:24.333+0530] {manager.py:172} INFO - DAG bundles loaded: dag_maker, another_bundle_name, example_dags ``` cc @kaxil -- 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