code: #  Copyright 2023 LanceDB Developers
  #
  #  Licensed 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 lancedb
  import pyarrow as pa
  from lancedb.remote.client import VectorQuery, VectorQueryResult
  
  
  class FakeLanceDBClient:
      def close(self):
          pass
  
      def query(self, table_name: str, query: VectorQuery) -> VectorQueryResult:
          assert table_name == "test"
          t = pa.schema([]).empty_table()
          return VectorQueryResult(t)
  
      def post(self, path: str):
          pass
  
      def mount_retry_adapter_for_table(self, table_name: str):
          pass
  
  
  def test_remote_db():
      conn = lancedb.connect("db://client-will-be-injected", api_key="fake")
      setattr(conn, "_client", FakeLanceDBClient())
  
      table = conn["test"]
      table.schema = pa.schema([pa.field("vector", pa.list_(pa.float32(), 2))])
      table.search([1.0, 2.0]).to_pandas()
  
apis: lancedb.connect lancedb.remote.client.VectorQueryResult
extract_api: [((1101, 1164), 'lancedb.connect', 'lancedb.connect', (['"""db://client-will-be-injected"""'], {'api_key': '"""fake"""'}), "('db://client-will-be-injected', api_key='fake')\n", (1116, 1164), False, 'import lancedb\n'), ((924, 944), 'lancedb.remote.client.VectorQueryResult', 'VectorQueryResult', (['t'], {}), '(t)\n', (941, 944), False, 'from lancedb.remote.client import VectorQuery, VectorQueryResult\n'), ((881, 894), 'pyarrow.schema', 'pa.schema', (['[]'], {}), '([])\n', (890, 894), True, 'import pyarrow as pa\n'), ((1299, 1311), 'pyarrow.float32', 'pa.float32', ([], {}), '()\n', (1309, 1311), True, 'import pyarrow as pa\n')]