Vamsi-klu commented on code in PR #69749:
URL: https://github.com/apache/airflow/pull/69749#discussion_r3725611779
##########
providers/google/tests/unit/google/cloud/hooks/vertex_ai/test_generative_model.py:
##########
@@ -23,6 +23,7 @@
# For no Pydantic environment, we need to skip the tests
pytest.importorskip("google.cloud.aiplatform_v1")
+pytest.importorskip("vertexai.preview.evaluation")
Review Comment:
Good catch, thanks for pointing this out! You are right, this was not
intended.
The `pytest.importorskip("vertexai.preview.evaluation")` in those two files
would fire in the default CI image since it uses `uv sync --all-packages
--group ci-image` without extras, and those files only contain
`test_run_evaluation` and `test_execute`. So we would end up with no coverage
for the evaluation path in CI.
I pushed a fix in 4c25fa3cbe:
- Removed the `importorskip` for `vertexai.preview.evaluation` from both
`test_generative_model.py` files
- Wrapped the `MetricPromptTemplateExamples` import in a try/except and fall
back to a `MagicMock` with the `Pointwise` values when the evaluation extra is
not installed. The tests already mock `get_eval_task` and
`get_generative_model`, so this lets the wiring be tested without needing the
real `litellm` stack
- Also cleaned up the leftover merge markers in `changelog.rst`
Verified locally that `pytest --collect-only` now shows 2 tests collected
and both pass, and the `test_generative_model_optional_evaluation.py` tests for
the missing extra still pass. Let me know if you would prefer to keep the skip
and instead run these tests in a job with the evaluation extra, happy to adjust.
--
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]