Make Vertex AI evaluation optional to avoid litellm bloat#69749
Draft
Vamsi-klu wants to merge 2 commits into
Draft
Make Vertex AI evaluation optional to avoid litellm bloat#69749Vamsi-klu wants to merge 2 commits into
Vamsi-klu wants to merge 2 commits into
Conversation
Base dependency on google-cloud-aiplatform[evaluation] forced litellm, scikit-learn, tokenizers for all users. Move evaluation extra behind optional provider extra 'evaluation'. Add lazy import guard with AirflowOptionalProviderFeatureException in GenerativeModelHook. Users needing RunEvaluationOperator should install apache-airflow-providers-google[evaluation]. Fixes: apache#69323
Contributor
Author
|
Reviewers: @shahar1 (google provider CODEOWNER). Breaking change: evaluation extra now optional to avoid litellm bloat. Changelog entry added, provider docs regenerated via update-providers-dependencies. Fixes #69323 Drafted-by: Muse Spark 1.1; reviewed by @Vamsi-klu before posting |
Use TYPE_CHECKING guard and Any fallback to satisfy mypy when evaluation extra not installed. Runtime guard still raises AirflowOptionalProviderFeatureException before using None types. Fixes mypy failure in CI for apache#69323
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
apache-airflow-providers-google base depends on google-cloud-aiplatform[evaluation] which pulls litellm, scikit-learn, ruamel-yaml, tqdm, huggingface-hub, tokenizers. Users of GCS/BigQuery get ML eval stack they never use. litellm has frequent proxy-server CVEs (auth bypass, RCE) triaged by every user.
Root cause: providers/google/pyproject.toml:86
"google-cloud-aiplatform[evaluation]>=1.155.0"
Code needing evaluation: vertexai.preview.evaluation.EvalResult, EvalTask used only in GenerativeModelHook.get_eval_task() and run_evaluation() and RunEvaluationOperator.
What I did
Part A: pyproject.toml
Part B: Lazy import guard in hook
Part C: Tests use pytest.importorskip("vertexai.preview.evaluation") to skip gracefully when extra not installed
Part D: Changelog breaking change note directly edited per provider rules
Generated files via prek update-providers-dependencies --all-files: README, docs/index.rst, provider info
Impact
Testing
Fixes: #69323
Was generative AI tooling used to co-author this PR?
Generated-by: Muse Spark 1.1