docstr: target: test table insert apis
  method:
  1. create tables
      - 'table_2'
          - c1 int primary key
          - c2 int null
  2. insert
      - insert into table_2 (c1, c2) values(1, 2)     √
      - insert into table_2 (c2, c1) values(1, 2)     √
      - insert into table_2 (c1) values(3)            √
  3. select all
      - 1, 2
      - 2, 1
      - 3, null
  4. drop tables
      - 'table_2'
  expect: all operations successfully
docstr_tok: ["target",":","test","table","insert","apis","method",":","1.","create","tables","-","'table_2'","-","c1","int","primary","key","-","c2","int","null","2.","insert","-","insert","into","table_2","(","c1",",","c2",")","values","(","1",",","2",")","\u221a","-","insert","into","table_2","(","c2",",","c1",")","values","(","1",",","2",")","\u221a","-","insert","into","table_2","(","c1",")","values","(","3",")","\u221a","3.","select","all","-","1",",","2","-","2",",","1","-","3",",","null","4.","drop","tables","-","'table_2'","expect",":","all","operations","successfully"]
code: def test_insert_basic(self):
      """
      target: test table insert apis
      method:
      1. create tables
          - 'table_2'
              - c1 int primary key
              - c2 int null
      2. insert
          - insert into table_2 (c1, c2) values(1, 2)     √
          - insert into table_2 (c2, c1) values(1, 2)     √
          - insert into table_2 (c1) values(3)            √
      3. select all
          - 1, 2
          - 2, 1
          - 3, null
      4. drop tables
          - 'table_2'
      expect: all operations successfully
      """
      infinity_obj = infinity.connect(REMOTE_HOST)
      db_obj = infinity_obj.get_database("default")
  
      db_obj.drop_table(table_name="table_2", if_exists=True)
      # infinity
      table_obj = db_obj.create_table(
          "table_2",
          {"c1": "int, primary key, not null", "c2": "int, not null"},
          None,
      )
      assert table_obj is not None
  
      res = table_obj.insert([{"c1": 0, "c2": 0}])
      assert res.success
  
      res = table_obj.insert([{"c1": 1, "c2": 1}])
      assert res.success
  
      res = table_obj.insert({"c2": 2, "c1": 2})
      assert res.success
  
      res = table_obj.insert([{"c2": 3, "c1": 3}, {"c1": 4, "c2": 4}])
      assert res.success
  
      res = table_obj.output(["*"]).to_df()
      pd.testing.assert_frame_equal(
          res,
          pd.DataFrame(
              {"c1": (0, 1, 2, 3, 4), "c2": (0, 1, 2, 3, 4)}
          ).astype({"c1": dtype("int32"), "c2": dtype("int32")}),
      )
  
      res = db_obj.drop_table("table_2")
      assert res.success
  
      # disconnect
      res = infinity_obj.disconnect()
  
      assert res.success
  
file_path: infinity/python/test/test_insert.py
imports: import pandas
  from numpy import dtype
  import infinity
  from infinity.common import REMOTE_HOST
label_desc: Use image node_id 2 for calling the TestInsert obj's underlying member method code with example usage: obj.test_insert_basic() without return types