class_docstr: A collection of data which can be pre-processed in parallel on Spark.
class_docstr_tok: ["A","collection","of","data","which","can","be","pre-processed","in","parallel","on","Spark","."]
docstr: Sort the value of shards. This is only applicable for SparkXShards of Pandas Series.
  
  :param col_names list of column or column names to sort by
  :param ascending bool, default True. Specify sort orders
  :return: a new SparkXShards sorted by the specified columns.
docstr_tok: ["Sort","the","value","of","shards",".","This","is","only","applicable","for","SparkXShards","of","Pandas","Series",".",":","param","col_names","list","of","column","or","column","names","to","sort","by",":","param","ascending","bool",",","default","True",".","Specify","sort","orders",":","return",":","a","new","SparkXShards","sorted","by","the","specified","columns","."]
code: def sort_values(
      self,
      col_names: Optional[Union[str, List[str]]] = None,
      ascending: bool = True,
  ) -> Optional["SparkXShards"]:
      """
      Sort the value of shards. This is only applicable for SparkXShards of Pandas Series.
  
      :param col_names list of column or column names to sort by
      :param ascending bool, default True. Specify sort orders
      :return: a new SparkXShards sorted by the specified columns.
      """
      if self._get_class_name() == "pandas.core.frame.DataFrame":
          import pandas as pd
  
          df = self.to_spark_df()
          sqlContext = get_spark_sql_context(get_spark_context())
          defaultPartitionNum = sqlContext.getConf(
              "spark.sql.shuffle.partitions"
          )
          partitionNum = df.rdd.getNumPartitions()
          sqlContext.setConf(
              "spark.sql.shuffle.partitions", str(partitionNum)
          )
          sort_df = df.sort(
              col_names, ascending=ascending
          )  # type:ignore
          data_shards = spark_df_to_pd_sparkxshards(sort_df)
          sqlContext.setConf(
              "spark.sql.shuffle.partitions", defaultPartitionNum
          )
          return data_shards
      else:
          invalidInputError(
              False,
              "Currently only support sort() on XShards of Pandas DataFrame",
          )
      return None
  
imports: from py4j.protocol import Py4JError
  from bigdl.orca.data.utils import *
  from bigdl.orca import OrcaContext
  from bigdl.dllib.utils.common import get_node_and_core_number, get_spark_sql_context, get_spark_context
  from bigdl.dllib.utils import nest
  from bigdl.dllib.utils.log4Error import invalidInputError
  import numpy
  from typing import TYPE_CHECKING, Any
  from typing import Callable, Dict, List, Optional, Tuple, Union
label_desc: Use image node_id 19 for calling the SparkXShards obj's underlying member method code with example usage: obj.sort_values(col_names, ascending) and returns: None, data_shards