class_docstr: Test class for Anyscale Endpoints Integration Testing.
  It follows tests for OpenAI's handler closely as the Anyscale handler inherits from it.
  Notably, no assertions are done on the as the 7B model is not very good at this task.
class_docstr_tok: ["Test","class","for","Anyscale","Endpoints","Integration","Testing",".","It","follows","tests","for","OpenAI","'s","handler","closely","as","the","Anyscale","handler","inherits","from","it",".","Notably",",","no","assertions","are","done","on","the","as","the","7B","model","is","not","very","good","at","this","task","."]
docstr: Tests normal completions (e.g. text-davinci-003) with bulk joins that are larger than the max batch_size
docstr_tok: ["Tests","normal","completions","(","e.g",".","text-davinci-003",")","with","bulk","joins","that","are","larger","than","the","max","batch_size"]
code: def test_7_bulk_normal_completion(self, mock_handler):
      """Tests normal completions (e.g. text-davinci-003) with bulk joins that are larger than the max batch_size"""
  
      class MockHandlerStorage:
          def json_get(self, key):
              return {"ft-suffix": {"ft-suffix": "$"}}[
                  key
              ]  # finetuning suffix, irrelevant for this test but needed for init  # noqa
  
      # create project
      handler = AnyscaleEndpointsHandler(
          model_storage=None,  # the storage does not matter for this test
          engine_storage=MockHandlerStorage(),  # nor does this, but we do need to pass some object due to the init procedure  # noqa
      )
      N = (
          1 + handler.max_batch_size
      )  # get N larger than default batch size
      df = pd.DataFrame.from_dict({"input": ["I feel happy!"] * N})
      self.set_handler(mock_handler, name="pg", tables={"df": df})
      with self._use_anyscale_api_key() as api_key:
          self.run_sql(
              f"""
                 create model proj.test_anyscale_bulk_normal_completion
                 predict completion
                 using
                   engine='anyscale_endpoints',
                   prompt_template='What is the sentiment of the following phrase? Answer either "positive" or "negative": {{{{input}}}}',
                   api_key='{api_key}';
              """  # noqa
          )
      self.wait_predictor(
          "proj", "test_anyscale_bulk_normal_completion"
      )
  
      self.run_sql(
          """
              SELECT p.completion
              FROM pg.df as t
              JOIN proj.test_anyscale_bulk_normal_completion as p;
          """
      )
  
imports: import os
  import time
  import pytest
  import contextlib
  import pandas
  from unittest.mock import patch
  from mindsdb_sql import parse_sql
  from mindsdb.integrations.handlers.anyscale_endpoints_handler.anyscale_endpoints_handler import AnyscaleEndpointsHandler
  from ..executor_test_base import BaseExecutorTest
label_desc: Use image node_id 11 for calling the TestAnyscaleEndpoints obj's underlying member method code with example usage: obj.test_7_bulk_normal_completion(mock_handler) and returns: dict