code: def test_to_json(self, da, dc, sa, ia):
      df = DataFrame(
          {
              "A": da,
              "B": dc,
              "C": sa,
              "D": ia,
          }
      )
      df.index.name = "idx"
      result = df.to_json(orient="table", date_format="iso")
      result = json.loads(result, object_pairs_hook=OrderedDict)
  
      assert "pandas_version" in result["schema"]
      result["schema"].pop("pandas_version")
  
      fields = [
          OrderedDict({"name": "idx", "type": "integer"}),
          OrderedDict(
              {"name": "A", "type": "any", "extDtype": "DateDtype"}
          ),
          OrderedDict(
              {"name": "B", "type": "number", "extDtype": "decimal"}
          ),
          OrderedDict(
              {"name": "C", "type": "any", "extDtype": "string"}
          ),
          OrderedDict(
              {"name": "D", "type": "integer", "extDtype": "Int64"}
          ),
      ]
  
      schema = OrderedDict({"fields": fields, "primaryKey": ["idx"]})
      data = [
          OrderedDict(
              [
                  ("idx", 0),
                  ("A", "2021-10-10T00:00:00.000"),
                  ("B", 10.0),
                  ("C", "pandas"),
                  ("D", 10),
              ]
          )
      ]
      expected = OrderedDict([("schema", schema), ("data", data)])
  
      assert result == expected
  
imports: from collections import OrderedDict
  import datetime
  import decimal
  from io import StringIO
  import json
  import pytest
  from pandas import NA, DataFrame, Index, array, read_json
  import pandas._testing
  from pandas.core.arrays.integer import Int64Dtype
  from pandas.core.arrays.string_ import StringDtype
  from pandas.core.series import Series
  from pandas.tests.extension.date import DateArray, DateDtype
  from pandas.tests.extension.decimal.array import DecimalArray, DecimalDtype
  from pandas.io.json._table_schema import as_json_table_type, build_table_schema
label_desc: Use image node_id 9 for calling the TestTableOrient obj's underlying member method code with example usage: obj.test_to_json(da, dc, sa, ia) without return types