VladaZakharova commented on code in PR #68479:
URL: https://github.com/apache/airflow/pull/68479#discussion_r3527264219


##########
providers/google/src/airflow/providers/google/cloud/hooks/vertex_ai/agent_engine.py:
##########
@@ -0,0 +1,406 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""This module contains a Google Cloud Vertex AI Agent Engine hook."""
+
+from __future__ import annotations
+
+import time
+from collections.abc import Sequence
+from typing import TYPE_CHECKING, Any
+
+import google.auth.transport.requests
+from aiohttp import ClientSession
+from asgiref.sync import sync_to_async

Review Comment:
   i think we don't need this import anymore if we don't use it



##########
providers/google/tests/system/google/cloud/vertex_ai/example_vertex_ai_agent_engine.py:
##########
@@ -0,0 +1,205 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""
+Example Airflow Dag for Google Vertex AI Agent Engine operations.
+"""
+
+from __future__ import annotations
+
+import json
+import os
+from datetime import datetime
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+    from vertexai._genai import types as vertexai_types
+
+from airflow.providers.google.cloud.operators.vertex_ai.agent_engine import (
+    CreateAgentEngineOperator,
+    DeleteAgentEngineOperator,
+    GetAgentEngineOperator,
+    RunQueryJobOperator,
+    UpdateAgentEngineOperator,
+)
+
+try:
+    from airflow.sdk import DAG, TriggerRule
+except ImportError:
+    # Compatibility for Airflow < 3.1
+    from airflow.models.dag import DAG  # type: 
ignore[attr-defined,no-redef,assignment]
+    from airflow.utils.trigger_rule import TriggerRule  # type: 
ignore[no-redef,attr-defined]
+
+DAG_ID = "vertex_ai_agent_engine_operations"
+ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID", "default")
+
+
+def _get_env(name: str, default: str = "") -> str:
+    return os.environ.get(name) or os.environ.get(f"AIRFLOW_VAR_{name}", 
default)
+
+
+def _get_json_env(name: str, default: dict[str, str]) -> dict[str, str]:
+    value = os.environ.get(name)
+    return json.loads(value) if value else default
+
+
+def _get_container_env_vars() -> dict[str, str]:
+    return _get_json_env(
+        "SYSTEM_TESTS_VERTEX_AI_AGENT_ENGINE_CONTAINER_ENV_VARS",
+        {},
+    )
+
+
+LOCATION = _get_env("GCP_REGION", "us-central1")
+PROJECT_ID = os.environ.get("SYSTEM_TESTS_GCP_PROJECT") or 
_get_env("GCP_PROJECT_ID", "default")
+CONTAINER_URI = 
os.environ.get("SYSTEM_TESTS_VERTEX_AI_AGENT_ENGINE_CONTAINER_URI") or _get_env(

Review Comment:
   Usually we are trying to make our tests as atomic as possible and if there 
is a way to use other services to create objects to be  used in system test, we 
are trying to use it. Can you please add a step to build this container and 
then delete it after execution?



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