Skip to main content

Run transforms quickly on local machine and analyse using DuckDb and pyspark

Project description

Transforms package

A package for transforming data using transform syntax similar to Palantir Foundry. It enables you to write and test transforms locally before running them on foundry. Also they can be run faster using duckdb as underlying data engine.

Getting Started

Installation

Install the package using pip:

pip install foundry-duck-transforms

Basic Usage

  1. Create a transform file (e.g. my_transform.py)
  2. Run it using the transforms CLI:
python -m transforms.run my_transform.py dev,master

Above command will run the transform while downloading data from dev, fallbacking to master if dataset has no data on dev.

CLI Options

The transforms runner supports several options to customize execution:

python -m transforms.run [OPTIONS] TRANSFORM_TO_RUN FALLBACK_BRANCHES

Available options:

  • --engine [spark|duckdb|spark-sail]: Engine to use for the transformation (default: spark)
  • --omit-checks: Disables checks running
  • --sail-server-url TEXT: Sail server url (required when using spark-sail engine)
  • --dry-run: Dry run the transformation without writing results
  • --local-dev-branch-name TEXT: Branch name for local development (default: "duck-fndry-dev")

Example with options:

python -m transforms.run my_transform.py dev,master --engine duckdb --dry-run

Development Setup

Prerequisites

  • Python 3.7+
  • pip
  • Access to Palantir Foundry environment

Local Development

  1. Clone the repository
  2. Install development dependencies:
pip install -e ".[dev]"

Foundry Dev Tools Configuration

See here for detailed configuration instructions.

VSCode Setup

Add this to your .vscode/launch.json for debugging support:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python Debugger: Current File",
      "type": "debugpy",
      "request": "launch",
      "module": "transforms.run",
      "args": ["${file}", "dev,master"],
      "console": "integratedTerminal"
    }
  ]
}

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foundry_duck_transforms-0.1.2.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

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

foundry_duck_transforms-0.1.2-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file foundry_duck_transforms-0.1.2.tar.gz.

File metadata

  • Download URL: foundry_duck_transforms-0.1.2.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for foundry_duck_transforms-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5ac4e48662efb5cfc98e7dc0ee6a273cc4ed84fb46ea879568b0d219d47cb5ff
MD5 a413dd43aa7da17921ed2040149b7fc9
BLAKE2b-256 d92ff6f5741e24b06782deae60c22d3563f8d39db71f0b27fd1a4c9aeda55c11

See more details on using hashes here.

File details

Details for the file foundry_duck_transforms-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for foundry_duck_transforms-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9bfe7b47463cc32ca70056ac0f62d9d93c532d7b7a562c016869d9c8a8b68f61
MD5 4465ffd86c748ddf6e1fcb871883f5a4
BLAKE2b-256 7ddd523d70b2be51a71c00bad37e75de607744c43c6389c7e3888caa2f1013a8

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