code: def test_union(self, mock_handler):
      self.set_handler(
          mock_handler, name="pg", tables={"tasks": self.df}
      )
  
      # --- use predictor ---
      self.set_predictor(self.task_predictor)
      sql = """
               SELECT a as a1, b as target
                FROM pg.tasks
             UNION {union}
               SELECT model.a as a2, model.p as target2
                FROM pg.tasks as t
               JOIN mindsdb.task_model as model
               WHERE t.a=1
          """
      # union all
      ret = self.execute(sql.format(union="ALL"))
  
      ret_df = self.ret_to_df(ret)
      assert list(ret_df.columns) == ["a1", "target"]
      assert ret_df.shape[0] == 3 + 2
  
      # union
      ret = self.execute(sql.format(union=""))
  
      ret_df = self.ret_to_df(ret)
      assert list(ret_df.columns) == ["a1", "target"]
      assert ret_df.shape[0] == 3
  
imports: from unittest.mock import patch
  import datetime
  import tempfile
  import pytest
  import pandas
  import numpy
  from mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender
  from mindsdb.api.executor.utilities.sql import query_df
  from mindsdb.api.mysql.mysql_proxy.utilities.lightwood_dtype import dtype
  from .executor_test_base import BaseExecutorMockPredictor
label_desc: Use image node_id 1 for calling the TestComplexQueries obj's underlying member method code with example usage: obj.test_union(mock_handler) without return types