Skip to main content

DDataFlow

DDataFlow is an end2end tests and local development solution for machine learning and data pipelines using pyspark. Check out this blogpost if you want to understand deeper its design motivation.

ddataflow overview

You can find our documentation under this link.

Features

  • Read a subset of our data so to speed up the running of the pipelines during tests
  • Write to a test location our artifacts so you don't pollute production
  • Download data for enabling local machine development

Enables to run on the pipelines in the CI

1. Install DDataflow

pip install ddataflow 

ddataflow --help will give you an overview of the available commands.

Getting Started (<5min Tutorial)

1. Setup some synthetic data

See the examples folder.

2. Create a ddataflow_config.py file

The command ddtaflow setup_project creates a file like this for you.

from ddataflow import DDataflow

config = {
    # add here your tables or paths with customized sampling logic
    "data_sources": {
        "demo_tours": {
            "source": lambda spark: spark.table('demo_tours'),
            "filter": lambda df: df.limit(500)
        }
        "demo_locations": {
            "source": lambda spark: spark.table('demo_locations'),
            "default_sampling": True,
        }
    },
    "project_folder_name": "ddataflow_demo",
}

# initialize the application and validate the configuration
ddataflow = DDataflow(**config)

3. Use ddataflow in a pipeline

from ddataflow_config import ddataflow

# replace spark.table for ddataflow source will return a spark dataframe
print(ddataflow.source('demo_locations').count())
# for sql queries replace only the name of the table for the sample data source name provided by ddataflow
print(spark.sql(f""" SELECT COUNT(1) from {ddataflow.name('demo_tours')}""").collect()[0]['count(1)'])

Now run it twice and observe the difference in the amount of records: python pipeline.py

ENABLE_DDATAFLOW=True python pipeline.py

You will see that the dataframes are sampled when ddataflow is enabled and full when the tool is disabled.

You completed the short demo!

How to develop

The recommended approach to use ddataflow is to use the offline mode, which allows you to test your pipelines without the need for an active cluster. This is especially important for development and debugging purposes, as it allows you to quickly test and identify any issues with your pipelines.

Alternatively, you can use Databricks Connect to test your pipelines on an active cluster. However, our experience with this approach has not been great, memory issues are common and there is the risk of overriding production data, so we recommend using the offline mode instead.

If you have any questions or need any help, please don't hesitate to reach out. We are here to help you get the most out of ddataflow.

Support

In case of questions feel free to reach out or create an issue.

Check out our FAQ in case of problems

Contributing

We welcome contributions to DDataFlow! If you would like to contribute, please follow these guidelines:

  1. Fork the repository and create a new branch for your contribution.
  2. Make your changes and ensure that the code passes all tests.
  3. Submit a pull request with a clear description of your changes and the problem it solves.

Please note that all contributions are subject to review and approval by the project maintainers. We appreciate your help in making DDataFlow even better!

If you have any questions or need any help, please don't hesitate to reach out. We are here to assist you throughout the contribution process.

License

DDataFlow is licensed under the MIT License.

Release files for DDataFlow 1.1.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DDataFlow 1.1.16
File Size Uploaded
ddataflow-1.1.16.tar.gz 17.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for DDataFlow 1.1.16
File Interpreter ABI Platform
ddataflow-1.1.16-py3-none-any.whl Python 3 none any Details

Total release size: 37.3 kB

Release files / ddataflow-1.1.16.tar.gz

Download URL ddataflow-1.1.16.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d65f295cae0910e2a5cddf30d2f164d3ae6b6ebdb7bdfad3295e4e6641ab7de3
BLAKE2b-256 checksum
How to use checksums
41c5eb9c33e26fdadc64910e4967d9eb6e35804da4a4e506f3aa4f0631f79ddb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1022-azure

Release files / ddataflow-1.1.16-py3-none-any.whl

Download URL ddataflow-1.1.16-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72586f43267e017578da52df6fb2129fac57df4c904c6cce271d2d1aaecf699b
BLAKE2b-256 checksum
How to use checksums
e23a5273fc1ebcc4f5c82459b4fde3cbf117fdc05870c5c02dabcc33f18f41a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1022-azure

Release history Release notifications | RSS feed

This release

1.1.16 This release

2 release files

1.1.12

2 release files

1.1.11

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.12

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page