IOMETE's PySpark library that contains useful utilities for working with PySpark
Project description
Pyspark IOMETE Library
This library is providing a set of utility functions to speed up the development of pyspark applications.
Installation
pip install pyspark-iomete
Utility functions
get_spark_logger
This function is returning a spark logger instance.
As you may know, spark is using log4j as a logging framework. This function is returning a spark logger instance that is using the log4j logger. Standard python logging is not working with pyspark. The following function get the spark logger instance and returns it.
Usage:
from pyspark_iomete.utils import get_spark_logger
from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate()
logger = get_spark_logger(spark=spark)
# or with a custom name
logger = get_spark_logger(spark=spark, name="my_custom_logger")
Test utility functions
table_name_with_random_suffix
This function is returning a table name with a random suffix. This is useful for testing purposes.
Usage:
from pyspark_iomete.test_utils import table_name_with_random_suffix
table_name = table_name_with_random_suffix("my_table")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyspark_iomete-0.0.2.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for pyspark_iomete-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c816ce29abf01d2cc0e51a4bbeed36d11f4a5f1601bbb34650785f81408b4985 |
|
MD5 | 6d77c7f8147f430c25b4d9cd3123178d |
|
BLAKE2b-256 | 385d662cf04448a22de3a0be1fb16436c09135d96b53e4712181293fb155becf |