code: def test_query(self):
      pdf = pd.DataFrame(
          {
              "A": range(1, 6),
              "B": range(10, 0, -2),
              "C": range(10, 5, -1),
          }
      )
      psdf = ps.from_pandas(pdf)
  
      exprs = ("A > B", "A < C", "C == B")
      for expr in exprs:
          self.assert_eq(psdf.query(expr), pdf.query(expr))
  
      # test `inplace=True`
      for expr in exprs:
          dummy_psdf = psdf.copy()
          dummy_pdf = pdf.copy()
  
          pser = dummy_pdf.A
          psser = dummy_psdf.A
          dummy_pdf.query(expr, inplace=True)
          dummy_psdf.query(expr, inplace=True)
  
          self.assert_eq(dummy_psdf, dummy_pdf)
          self.assert_eq(psser, pser)
  
      # invalid values for `expr`
      invalid_exprs = (1, 1.0, (exprs[0],), [exprs[0]])
      for expr in invalid_exprs:
          with self.assertRaisesRegex(
              TypeError,
              "expr must be a string to be evaluated, {} given".format(
                  type(expr).__name__
              ),
          ):
              psdf.query(expr)
  
      # invalid values for `inplace`
      invalid_inplaces = (1, 0, "True", "False")
      for inplace in invalid_inplaces:
          with self.assertRaisesRegex(
              TypeError,
              'For argument "inplace" expected type bool, received type {}.'.format(
                  type(inplace).__name__
              ),
          ):
              psdf.query("a < b", inplace=inplace)
  
      # doesn't support for MultiIndex columns
      columns = pd.MultiIndex.from_tuples(
          [("A", "Z"), ("B", "X"), ("C", "C")]
      )
      psdf.columns = columns
      with self.assertRaisesRegex(
          TypeError, "Doesn't support for MultiIndex columns"
      ):
          psdf.query("('A', 'Z') > ('B', 'X')")
  
imports: import unittest
  import numpy
  import pandas
  from pyspark import pandas
  from pyspark.pandas.config import option_context
  from pyspark.testing.pandasutils import ComparisonTestBase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 10 for calling the FrameIndexingMixin obj's underlying member method code with example usage: obj.test_query() without return types