Vamsi-klu commented on PR #69406:
URL: https://github.com/apache/airflow/pull/69406#issuecomment-4912281953

   Confirmed the root cause against the hook source. The old line was `assert 
mock_client.run_sql.asssert_called_once_with(...)` with a triple-s typo; on a 
MagicMock that attribute auto-creates a child mock, calling it returns a truthy 
mock, and the wrapping assert passed unconditionally, so the forwarded kwargs 
were never checked. The fix to a bare assert_called_once_with matches the 
sibling test_get_instance / test_stop_instance_success style. run_sql does `if 
priority is None and hints is not None: priority = 
hints.get("odps.instance.priority")`, then forwards priority=priority, 
hints=hints unchanged. The three parametrized cases line up: explicit 
priority=1 forwarded unchanged, (None, {"odps.instance.priority": 5}) -> 5, 
(None, None) -> None, and the hints dict is passed through unmodified so 
hints=hints is correct. The priority-from-hints branch was previously never 
exercised and now is. LGTM; nice catch on the silently-passing assertion.
   


-- 
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]

Reply via email to