Skip to content

pysparky_config

Type part of a name or a dotted path

Standard-library helpers for composing Spark configuration mappings.

Classes

NameDescription
AwsS3SparkConfigObject-oriented wrapper around aws_s3_spark_config.
AwsS3TablesSparkConfigObject-oriented wrapper for the S3 Tables Iceberg REST preset.

Functions

NameDescription
aws_glue_rest_spark_configBuild a Spark map for the AWS Glue Iceberg REST endpoint.
aws_glue_spark_configBuild an Iceberg Glue catalog map using the Iceberg AWS dependency bundle.
aws_s3_spark_configBuild a Hadoop S3A config map for a caller-selected Hadoop release.
aws_s3_tables_spark_configBuild an Iceberg REST configuration map for an S3 Tables bucket.
compose_spark_configsCompose Spark config maps with explicit scalar conflict handling.
iceberg_spark_configBuild an Iceberg Hadoop, Hive, or REST catalog configuration map.
mongodb_spark_configBuild a MongoDB Spark Connector dependency map without connection data.

Modules

  • compositionDeterministic composition for string-valued Spark configuration maps.
  • presetsExplicit-version Spark configuration presets.

AwsS3SparkConfigclassdataclass#

class AwsS3SparkConfig(hadoop_version: str)

Object-oriented wrapper around aws_s3_spark_config.

hadoop_versionattributeinstance attribute#

hadoop_version: str

to_spark_config_mapmethod#

def to_spark_config_map() -> dict[str, str]

AwsS3TablesSparkConfigclassdataclass#

class AwsS3TablesSparkConfig(spark_version: str, scala_binary_version: str, iceberg_version: str, catalog_name: str, region: str, table_bucket_arn: str)

Object-oriented wrapper for the S3 Tables Iceberg REST preset.

catalog_nameattributeinstance attribute#

catalog_name: str

iceberg_versionattributeinstance attribute#

iceberg_version: str

regionattributeinstance attribute#

region: str

scala_binary_versionattributeinstance attribute#

scala_binary_version: str

spark_versionattributeinstance attribute#

spark_version: str

table_bucket_arnattributeinstance attribute#

table_bucket_arn: str

to_spark_config_mapmethod#

def to_spark_config_map() -> dict[str, str]

aws_glue_rest_spark_configfunction#

def aws_glue_rest_spark_config(spark_version: str, scala_binary_version: str, iceberg_version: str, catalog_name: str, region: str, aws_account_id: str) -> dict[str, str]

Build a Spark map for the AWS Glue Iceberg REST endpoint.

aws_account_id is emitted as Iceberg’s REST warehouse identifier. The function neither reads nor creates AWS credentials.

aws_glue_spark_configfunction#

def aws_glue_spark_config(spark_version: str, scala_binary_version: str, iceberg_version: str, catalog_name: str, warehouse: str) -> dict[str, str]

Build an Iceberg Glue catalog map using the Iceberg AWS dependency bundle.

AWS SDK libraries are supplied transitively by the version-matched iceberg-aws-bundle coordinate; this factory does not add a second SDK version. Authentication and region selection remain with the caller’s AWS runtime configuration.

aws_s3_spark_configfunction#

def aws_s3_spark_config(hadoop_version: str) -> dict[str, str]

Build a Hadoop S3A config map for a caller-selected Hadoop release.

Match hadoop_version to the Hadoop libraries supplied by the Spark distribution. Credentials are intentionally outside this preset.

aws_s3_tables_spark_configfunction#

def aws_s3_tables_spark_config(spark_version: str, scala_binary_version: str, iceberg_version: str, catalog_name: str, region: str, table_bucket_arn: str) -> dict[str, str]

Build an Iceberg REST configuration map for an S3 Tables bucket.

The Iceberg AWS bundle supplies the matching AWS SDK dependency set. The caller supplies a table-bucket ARN and the region; no network or IAM access occurs while constructing the map.

compose_spark_configsfunction#

def compose_spark_configs(*configs: Mapping[str, str], overrides: Mapping[str, str] | None = None) -> dict[str, str]

Compose Spark config maps with explicit scalar conflict handling.

Equal scalar values are kept once. Different scalar values raise ValueError unless the key appears in overrides. spark.jars.packages and spark.sql.extensions are merged as comma-separated lists in first-seen order, with exact duplicate entries removed. Package coordinates that name the same group and artifact at different versions raise ValueError.

The input mappings are not modified. Keys keep their first-seen order; an explicit override changes a value without moving its key. The function uses only the standard library and does not validate runtime compatibility or initialize Spark.

Raises

TypeError
If an input or override is not a string-to-string mapping.
ValueError
If a scalar conflict is unresolved, a list entry is malformed, a package coordinate is incompatible, or an override targets a list setting or unknown key.

iceberg_spark_configfunction#

def iceberg_spark_config(spark_version: str, scala_binary_version: str, iceberg_version: str, catalog_name: str, catalog_type: Literal['hadoop', 'hive', 'rest'], warehouse: str, catalog_uri: str | None = None) -> dict[str, str]

Build an Iceberg Hadoop, Hive, or REST catalog configuration map.

spark_version is the Spark major/minor line used in Iceberg’s runtime artifact name. This function does not verify that the selected Iceberg release exists or supports the host’s complete runtime tuple.

mongodb_spark_configfunction#

def mongodb_spark_config(spark_version: str, scala_binary_version: str, connector_version: str) -> dict[str, str]

Build a MongoDB Spark Connector dependency map without connection data.

Connector release compatibility must be checked against MongoDB’s current Spark/Scala compatibility table. Connection URIs and credentials are not accepted or emitted by this factory.