Skip to content

Commit dd0d0b3

Browse files
authored
Changes to support agents (#1507)
Removes automl implementation, which requires old protobuf (3.20.3). This enables it to be upgraded to a modern version, which is required by `google-adk[a2a]`. Also removes old unused `BigQuery_Helper`. Adds ADK `eval` and `a2a` as dependencies. http://b/455550872
1 parent f972e95 commit dd0d0b3

File tree

3 files changed

+4
-40
lines changed

3 files changed

+4
-40
lines changed

Dockerfile.tmpl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ RUN uv pip install --system -r /requirements.txt
2323
RUN uv pip uninstall --system google-cloud-bigquery-storage
2424

2525
# b/394382016: sigstore (dependency of kagglehub) requires a prerelease packages, installing separate.
26-
# b/408284143: google-cloud-automl 2.0.0 introduced incompatible API changes, need to pin to 1.0.1,
27-
# installed outside of kaggle_requirements.txt due to requiring an incompatibile version of protobuf.
28-
RUN uv pip install --system --force-reinstall --prerelease=allow "kagglehub[pandas-datasets,hf-datasets,signing]>=0.3.12" \
29-
"google-cloud-automl==1.0.1"
26+
RUN uv pip install --system --force-reinstall --prerelease=allow "kagglehub[pandas-datasets,hf-datasets,signing]>=0.3.12"
3027

3128
# uv cannot install this in requirements.txt without --no-build-isolation
3229
# to avoid affecting the larger build, we'll post-install it.

kaggle_requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ geojson
4545
# geopandas > v0.14.4 breaks learn tools
4646
geopandas==v0.14.4
4747
gensim
48-
# b/443054743
49-
google-adk
48+
# b/443054743,b/455550872
49+
google-adk[a2a,eval]
5050
google-cloud-aiplatform
5151
# b/315753846: Unpin translate package.
5252
google-cloud-translate==3.12.1
@@ -152,5 +152,4 @@ wavio
152152
xgboost==2.0.3
153153
xvfbwrapper
154154
ydata-profiling
155-
# b/443054743: pinned as newer versions requires protobuf > 3.20.3
156-
ydf==0.9.0
155+
ydf

patches/kaggle_gcp.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -253,37 +253,6 @@ def init_gcs():
253253
KaggleKernelCredentials(target=GcpTarget.GCS))
254254
return storage
255255

256-
def init_automl():
257-
from google.cloud import automl, automl_v1beta1
258-
if not is_user_secrets_token_set():
259-
return
260-
261-
from kaggle_gcp import get_integrations
262-
if not get_integrations().has_cloudai():
263-
return
264-
265-
from kaggle_secrets import GcpTarget
266-
from kaggle_gcp import KaggleKernelCredentials
267-
kaggle_kernel_credentials = KaggleKernelCredentials(target=GcpTarget.CLOUDAI)
268-
269-
# Patch the 2 GA clients: AutoMlClient and PreditionServiceClient
270-
monkeypatch_client(automl.AutoMlClient, kaggle_kernel_credentials)
271-
monkeypatch_client(automl.PredictionServiceClient, kaggle_kernel_credentials)
272-
273-
# The AutoML client library exposes 3 different client classes (AutoMlClient,
274-
# TablesClient, PredictionServiceClient), so patch each of them.
275-
# The same KaggleKernelCredentials are passed to all of them.
276-
# The GcsClient class is only used internally by TablesClient.
277-
278-
# The beta version of the clients that are now GA are included here for now.
279-
# They are deprecated and will be removed by 1 May 2020.
280-
monkeypatch_client(automl_v1beta1.AutoMlClient, kaggle_kernel_credentials)
281-
monkeypatch_client(automl_v1beta1.PredictionServiceClient, kaggle_kernel_credentials)
282-
283-
# The TablesClient is still in beta, so this will not be deprecated until
284-
# the TablesClient is GA.
285-
monkeypatch_client(automl_v1beta1.TablesClient, kaggle_kernel_credentials)
286-
287256
def init_translation_v2():
288257
from google.cloud import translate_v2
289258
if not is_user_secrets_token_set():
@@ -379,7 +348,6 @@ def init_vision():
379348
def init():
380349
init_bigquery()
381350
init_gcs()
382-
init_automl()
383351
init_translation_v2()
384352
init_translation_v3()
385353
init_natural_language()

0 commit comments

Comments
 (0)