class_docstr: Test mindsdb mysql api.
  All sql commands are being executed through a docker container with mysql client within.
  In general all tests do next:
      1. Do some preconditions
      2. Specify SQL query needs to be executed
      3. Launch a docker container with mysql client
      4. Send the query to the container
      5. Mysql client inside the container connects to mindsdb mysql api
      and execute the query
class_docstr_tok: ["Test","mindsdb","mysql","api",".","All","sql","commands","are","being","executed","through","a","docker","container","with","mysql","client","within",".","In","general","all","tests","do","next",":","1",".","Do","some","preconditions","2",".","Specify","SQL","query","needs","to","be","executed","3",".","Launch","a","docker","container","with","mysql","client","4",".","Send","the","query","to","the","container","5",".","Mysql","client","inside","the","container","connects","to","mindsdb","mysql","api","and","execute","the","query"]
code: def test_ts_train_and_predict(self, subtests):
      train_df = pd.DataFrame(
          {
              "gby": ["A" for _ in range(100, 210)]
              + ["B" for _ in range(100, 210)],
              "oby": [x for x in range(100, 210)]
              + [x for x in range(200, 310)],
              "x1": [x for x in range(100, 210)]
              + [x for x in range(100, 210)],
              "x2": [x * 2 for x in range(100, 210)]
              + [x * 3 for x in range(100, 210)],
              "y": [x * 3 for x in range(100, 210)]
              + [x * 2 for x in range(100, 210)],
          }
      )
  
      test_df = pd.DataFrame(
          {
              "gby": ["A" for _ in range(210, 220)]
              + ["B" for _ in range(210, 220)],
              "oby": [x for x in range(210, 220)]
              + [x for x in range(310, 320)],
              "x1": [x for x in range(210, 220)]
              + [x for x in range(210, 220)],
              "x2": [x * 2 for x in range(210, 220)]
              + [x * 3 for x in range(210, 220)],
              "y": [x * 3 for x in range(210, 220)]
              + [x * 2 for x in range(210, 220)],
          }
      )
  
      train_ds_name = "train_ts_file_ds"
      test_ds_name = "test_ts_file_ds"
      for df, ds_name in [
          (train_df, train_ds_name),
          (test_df, test_ds_name),
      ]:
          self.upload_ds(df, ds_name)
          self.verify_file_ds(ds_name)
  
      params = [
          (
              "with_group_by_hor1",
              f"CREATE MODEL %s from files (select * from {train_ds_name}) PREDICT y ORDER BY oby GROUP BY gby WINDOW 10 HORIZON 1;",
              f"SELECT res.gby, res.y as PREDICTED_RESULT FROM files.{test_ds_name} as source JOIN mindsdb.%s as res WHERE source.gby= 'A' LIMIT 1;",
              1,
          ),
          (
              "no_group_by_hor1",
              f"CREATE MODEL %s from files (select * from {train_ds_name}) PREDICT y ORDER BY oby WINDOW 10 HORIZON 1;",
              f"SELECT res.gby, res.y as PREDICTED_RESULT FROM files.{test_ds_name} as source JOIN mindsdb.%s as res LIMIT 1;",
              1,
          ),
          (
              "with_group_by_hor2",
              f"CREATE MODEL %s from files (select * from {train_ds_name}) PREDICT y ORDER BY oby GROUP BY gby WINDOW 10 HORIZON 2;",
              f"SELECT res.gby, res.y as PREDICTED_RESULT FROM files.{test_ds_name} as source JOIN mindsdb.%s as res WHERE source.gby= 'A' LIMIT 2;",
              2,
          ),
          (
              "no_group_by_hor2",
              f"CREATE MODEL %s from files (select * from {train_ds_name}) PREDICT y ORDER BY oby WINDOW 10 HORIZON 2;",
              f"SELECT res.gby, res.y as PREDICTED_RESULT FROM files.{test_ds_name} as source JOIN mindsdb.%s as res LIMIT 2;",
              2,
          ),
      ]
      for predictor_name, create_query, select_query, res_len in params:
          with subtests.test(
              msg=predictor_name,
              predictor_name=predictor_name,
              create_query=create_query,
              select_query=select_query,
              res_len=res_len,
          ):
              self.query(create_query % predictor_name)
              self.check_predictor_readiness(predictor_name)
              res = self.query(select_query % predictor_name)
              assert (
                  len(res) == res_len
              ), f"prediction result {res} contains more that {res_len} records"
  
imports: import os
  import time
  import tempfile
  import json
  from pathlib import Path
  import docker
  import pandas
  import requests
  import pytest
  from .conftest import docker_inet_ip, TEMP_DIR
label_desc: Use image node_id 12 for calling the TestMySqlApi obj's underlying member method code with example usage: obj.test_ts_train_and_predict(subtests) without return types