spark.core.config#
Attributes#
Classes#
Metaclass that promotes class attributes to dataclass fields |
|
Base class for module configuration. |
|
Default class for module configuration. |
Module Contents#
- class spark.core.config.SparkMetaConfig[source]#
Bases:
abc.ABCMetaMetaclass that promotes class attributes to dataclass fields
- class spark.core.config.BaseSparkConfig(**kwargs)[source]#
Bases:
abc.ABCBase class for module configuration.
- diff(other)[source]#
Return differences from another config.
- Parameters:
other (BaseSparkConfig)
- Return type:
- get_metadata()[source]#
Returns all the metadata in the configuration class, indexed by the attribute name.
- property class_ref: type[source]#
Returns the type of the associated Module/Initializer.
NOTE: It is recommended to set the __class_ref__ to the name of the associated module/initializer when defining custom configuration classes. The current class_ref solver is extremely brittle and likely to fail in many different custom scenarios.
- Return type:
- classmethod from_dict(dct)[source]#
Create config instance from dictionary.
- Parameters:
dct (dict)
- Return type:
- to_file(file_path)[source]#
Export a config instance from a .scfg file.
- Parameters:
file_path (str)
- Return type:
None
- classmethod from_file(file_path)[source]#
Create config instance from a .scfg file.
- Parameters:
file_path (str)
- Return type:
None
- __iter__()[source]#
Custom iterator to simplify SparkConfig inspection across the entire ecosystem. This iterator excludes private fields.
- Output:
field_name: str, field name field_value: tp.Any, field value
- Return type:
Iterator[tuple[str, dataclasses.Field, Any]]