Copilot commented on code in PR #11060:
URL: https://github.com/apache/gravitino/pull/11060#discussion_r3247890700


##########
lance/lance-rest-server/src/test/java/org/apache/gravitino/lance/integration/test/LanceRESTServiceIT.java:
##########
@@ -429,12 +427,12 @@ void testCreateEmptyTable() throws ApiException {
     catalog = createCatalog(CATALOG_NAME);
     createSchema();
 
-    CreateEmptyTableRequest request = new CreateEmptyTableRequest();
+    DeclareTableRequest request = new DeclareTableRequest();
     String location = tempDir + "/" + "empty_table/";
     request.setLocation(location);
     request.setId(List.of(CATALOG_NAME, SCHEMA_NAME, "empty_table"));
 
-    CreateEmptyTableResponse response = ns.createEmptyTable(request);
+    DeclareTableResponse response = ns.declareTable(request);
     Assertions.assertNotNull(response);
     Assertions.assertEquals(location, response.getLocation());

Review Comment:
   The test method name `testCreateEmptyTable` no longer matches the behavior 
under test (it now calls `ns.declareTable(...)`). Renaming the test to reflect 
the declare-table API (or adding a separate legacy create-empty test if needed) 
would make the intent clearer and reduce confusion when debugging failures.



##########
clients/client-python/requirements-dev.txt:
##########
@@ -33,3 +33,9 @@ jwcrypto==1.5.6
 sphinx==7.1.2
 furo==2024.8.6
 banks==2.4.1
+
+# Lance integration deps. Pinned so integration tests run against a single,
+# known-good server-side `lance-namespace-core` 0.7.5+ combination.
+ray==2.55.1
+lance-ray==0.4.2
+lance-namespace==0.7.5

Review Comment:
   Adding `ray`, `lance-ray`, and `lance-namespace` to the generic `dev` extra 
means *every* `pip install -e .[dev]` (and thus CI lint/unit-test tasks) will 
pull these large, platform-sensitive dependencies, which can significantly slow 
installs or fail on unsupported platforms. Consider moving these to a separate 
optional extra (e.g. `extras_require["lance_ray"]`) or a dedicated requirements 
file that only the lance-ray integration test task installs.
   



##########
clients/client-python/tests/integration/test_lance_ray.py:
##########
@@ -0,0 +1,325 @@
+# 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.
+
+import logging
+import os
+import shutil
+import tempfile
+import time
+import unittest
+from random import randint
+from typing import Optional
+
+import requests
+
+from gravitino import (
+    Catalog,
+    GravitinoAdminClient,
+    GravitinoClient,
+)
+from tests.integration.integration_test_env import IntegrationTestEnv
+
+logger = logging.getLogger(__name__)
+
+LANCE_REST_PORT = 9101
+LANCE_REST_BASE_URL = f"http://localhost:{LANCE_REST_PORT}/lance";
+
+# The Lance REST server runs as an auxiliary service inside the main
+# Gravitino process (gravitino.auxService.names = ...,lance-rest), so its
+# bind metalake is configured in the *main* gravitino.conf rather than the
+# standalone lance-rest conf file.
+MAIN_CONF_FILE = "conf/gravitino.conf"
+LANCE_REST_METALAKE_KEY = "gravitino.lance-rest.gravitino-metalake"
+
+
+def _missing_lance_ray_deps() -> Optional[str]:
+    missing = []
+    for mod in ("ray", "lance_ray", "lance_namespace"):
+        try:
+            __import__(mod)
+        except ImportError:
+            missing.append(mod)
+    return ", ".join(missing) if missing else None
+
+
[email protected](
+    _missing_lance_ray_deps() is not None,
+    f"lance-ray test deps not installed: {_missing_lance_ray_deps()}. "

Review Comment:
   `_missing_lance_ray_deps()` is invoked twice in the `@skipIf` decorator 
(once for the condition and once inside the f-string), which repeats import 
attempts at module-import time. Compute it once (e.g., a module-level 
`MISSING_LANCE_RAY_DEPS = _missing_lance_ray_deps()`) and reuse to avoid 
duplicate work and potential side effects from repeated imports.
   



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