Skip to main content

Testing Framework for SparkPipelineFramework

Project description

Build and Test

Upload Python Package

Known Vulnerabilities

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

  1. 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)
  2. Create an input folder and put in files that represent the input views. These files can be csv, json or parquet
  3. (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.
  4. (Optional) Create an output folder and put in files that represent the output views you expect. These files can be csv, json or parquet
  5. (Optional) Create an output_schema folder and put in any schemas you want applied to the output views
  6. 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)
  1. 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

  1. Create a new release
  2. The GitHub Action should automatically kick in and publish the package
  3. 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

sparkpipelineframework_testing-4.0.5.tar.gz (42.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sparkpipelineframework_testing-4.0.5-py3-none-any.whl (99.7 kB view details)

Uploaded Python 3

File details

Details for the file sparkpipelineframework_testing-4.0.5.tar.gz.

File metadata

File hashes

Hashes for sparkpipelineframework_testing-4.0.5.tar.gz
Algorithm Hash digest
SHA256 5bf44e065c3041ac4ae0c4652dcc904ae04b7718d77e47e094a4231285a5ee28
MD5 2432afa81dc741038a5b970e00c7b333
BLAKE2b-256 18a6f5607388ef5c000b0246b8b85ce6c834a81f74a8f96313d1f454835e4fe0

See more details on using hashes here.

File details

Details for the file sparkpipelineframework_testing-4.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for sparkpipelineframework_testing-4.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 826fd6800ff2ec222034dcb09a8b88be871b2124cfcf3931ecd9b26ac60f90ac
MD5 48d7fc5c54b2b343cf642ba7b3353516
BLAKE2b-256 715ce10fdd4140b2945e1075752a4d34ab33c41e73e75902c7627605a6a2f979

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page