class_docstr: These test cases exercise the interface to the proto plan
  generation but do not call Spark.
class_docstr_tok: ["These","test","cases","exercise","the","interface","to","the","proto","plan","generation","but","do","not","call","Spark","."]
code: def test_window_order(self):
      # SPARK-41773: test window function with order
      data = [
          (1, "a"),
          (1, "a"),
          (2, "a"),
          (1, "b"),
          (2, "b"),
          (3, "b"),
      ]
      # +---+--------+
      # | id|category|
      # +---+--------+
      # |  1|       a|
      # |  1|       a|
      # |  2|       a|
      # |  1|       b|
      # |  2|       b|
      # |  3|       b|
      # +---+--------+
  
      cdf = self.connect.createDataFrame(data, ["id", "category"])
      sdf = self.spark.createDataFrame(data, ["id", "category"])
  
      cw = CW.partitionBy("id").orderBy("category")
      sw = SW.partitionBy("id").orderBy("category")
      self.assert_eq(
          cdf.withColumn(
              "row_number", CF.row_number().over(cw)
          ).toPandas(),
          sdf.withColumn(
              "row_number", SF.row_number().over(sw)
          ).toPandas(),
      )
  
      cw = CW.partitionBy("category").orderBy("id")
      sw = SW.partitionBy("category").orderBy("id")
      self.assert_eq(
          cdf.withColumn(
              "row_number", CF.row_number().over(cw)
          ).toPandas(),
          sdf.withColumn(
              "row_number", SF.row_number().over(sw)
          ).toPandas(),
      )
  
      cw = (
          CW.partitionBy("category")
          .orderBy("id")
          .rowsBetween(CW.currentRow, 1)
      )
      sw = (
          SW.partitionBy("category")
          .orderBy("id")
          .rowsBetween(SW.currentRow, 1)
      )
      self.assert_eq(
          cdf.withColumn("sum", CF.sum("id").over(cw))
          .sort("id", "category", "sum")
          .toPandas(),
          sdf.withColumn("sum", SF.sum("id").over(sw))
          .sort("id", "category", "sum")
          .toPandas(),
      )
  
      cw = (
          CW.partitionBy("category")
          .orderBy("id")
          .rangeBetween(CW.currentRow, 1)
      )
      sw = (
          SW.partitionBy("category")
          .orderBy("id")
          .rangeBetween(SW.currentRow, 1)
      )
      self.assert_eq(
          cdf.withColumn("sum", CF.sum("id").over(cw))
          .sort("id", "category")
          .toPandas(),
          sdf.withColumn("sum", SF.sum("id").over(sw))
          .sort("id", "category")
          .toPandas(),
      )
  
imports: import os
  import unittest
  from inspect import getmembers, isfunction
  from pyspark.errors import PySparkTypeError, PySparkValueError
  from pyspark.sql import SparkSession
  from pyspark.sql.types import StringType, StructType, StructField, ArrayType, IntegerType
  from pyspark.testing import assertDataFrameEqual
  from pyspark.testing.pandasutils import PandasOnSparkTestUtils
  from pyspark.testing.connectutils import ReusedConnectTestCase, should_test_connect
  from pyspark.testing.sqlutils import SQLTestUtils
  from pyspark.errors.exceptions.connect import AnalysisException, SparkConnectException
label_desc: Use image node_id 13 for calling the SparkConnectFunctionTests obj's underlying member method code with example usage: obj.test_window_order() without return types