Testing Framework for SparkPipelineFramework
Project description
SparkPipelineFramework.Tests
Testing framework that can tests SparkPipelineFramework library by just providing input files to setup before running the transformer and output files to use for verifying the output
Usage
- Create a folder structure similar to the folder structure of your library in SparkPipelineFramework (This is how the Testing Framework finds the Transformer to run)
- Create an input folder and put in files that represent the input views. These files can be csv, json or parquet
- (Optionally) Create an input_schema folder and put in any schemas you want applied to the above views. This follows the Spark Json Schema format.
- (Optional) Create an output folder and put in files that represent the output views you expect. These files can be csv, json or parquet
- (Optional) Create an output_schema folder and put in any schemas you want applied to the output views
- Copy the following test code and put it in a test file in this folder
from pathlib import Path
from pyspark.sql import SparkSession
from spark_pipeline_framework_testing.test_runner import SparkPipelineFrameworkTestRunner
def test_folder(spark_session: SparkSession) -> None:
data_dir: Path = Path(__file__).parent.joinpath('./')
SparkPipelineFrameworkTestRunner.run_tests(spark_session=spark_session, folder_path=data_dir)
- Now just run this test.
Note: the test finds files in sub-folders too.
Example
For the transformer defined here: https://github.com/imranq2/SparkPipelineFramework.Testing/tree/main/library/features/people/my_people_feature You can find the test here: https://github.com/imranq2/SparkPipelineFramework.Testing/tree/main/tests/library/features/people/my_people_feature
Publishing a new package
- Create a new release
- The GitHub Action should automatically kick in and publish the package
- You can see the status in the Actions tab
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
Built Distribution
Close
Hashes for sparkpipelineframework.testing-1.0.92.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aed7261e267adf0d5b5f0d5ba7d0d4462ca5a62126410d829195c2114560f8ef |
|
MD5 | 40d175b849ac3fd3783aae653f9e1d60 |
|
BLAKE2b-256 | f5ed14af627247400f9a8595394da2e910ef186fbf0fe5787b294934210563b3 |
Close
Hashes for sparkpipelineframework.testing-1.0.92-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30693ed0386fc6bb95e7c4c21142c02419ccb3166ab19f408d87228e77a9db38 |
|
MD5 | 55d0e1c887b093256624fbb64f019e02 |
|
BLAKE2b-256 | a3e25af18c56935eb66ad6835f109988a72af8fa35251e259cb9163a4383df22 |