def add_configure_spark_arguments(argparser):
    """Adds a set of arguments that are needed for spark session configuration.

    >>> from pyspark.sql import SparkSession
    >>>
    >>> arg_parser = argparse.ArgumentParser()
    >>> add_configure_spark_arguments(arg_parser)
    >>> # ... more argparse arguments

    >>> args = arg_parser.parse_args()
    >>> spark = configure_spark(SparkSession.builder.appName('petastorm-copy'), args).getOrCreate()

    :param argparser: An instance of ``argparse.ArgumentParser`` object
    :return: None
    """
    argparser.add_argument('--master', type=str,
                           help='Spark master. Default if not specified. To run on a local machine, specify '
                                '"local[W]" (where W is the number of local spark workers, e.g. local[10])')

    argparser.add_argument('--spark-session-config', type=str, nargs='+',
                           help='A list of "=" separated key-value pairs used to configure SparkSession object. '
                                'For example: --spark-session-config spark.executor.cores=2 spark.executor.memory=10g')
Adds a set of arguments that are needed for spark session configuration.

    >>> from pyspark.sql import SparkSession
    >>>
    >>> arg_parser = argparse.ArgumentParser()
    >>> add_configure_spark_arguments(arg_parser)
    >>> # ... more argparse arguments

    >>> args = arg_parser.parse_args()
    >>> spark = configure_spark(SparkSession.builder.appName('petastorm-copy'), args).getOrCreate()

    :param argparser: An instance of ``argparse.ArgumentParser`` object
    :return: None
    
petastorm/tools/spark_session_cli.py