Skip to main content

Airphin is a tool for migrating Airflow DAGs to DolphinScheduler Python API.

Project description

Airphin

PyPi Version PyPi Python Versions PyPi License PyPi Status Downloads Coverage Status Code style: black Imports: isort CI Documentation Status

Airphin is a tool for migrating Airflow DAGs to DolphinScheduler Python API.

Installation

For now, it just for test and without publish to pypi but will be adding in the future. You could still install locally by yourself.

python -m pip install --upgrade airphin

Quick Start

Here will give a quick example to show how to migrate base on standard input.

# Quick test the migrate rule for standard input
# Can also add option `--diff` to see the diff detail of this migrate
airphin test "from airflow.operators.bash import BashOperator

test = BashOperator(
    task_id='test',
    bash_command='echo 1',
)
"

And you will see the migrated result in the standard output. Airphin can only migrate standard input, it can also migrate file, directory and even can use in your python code. For more detail, please see our usage.

Documentation

The documentation host on read the doc and is available at https://airphin.readthedocs.io.

Support Statement

For now, we support following statement from Airflow's DAG files

DAG

Before Migration After Migration
from airflow import DAG from pydolphinscheduler.core.process_definition import ProcessDefinition
with DAG(...) as dag: pass with ProcessDefinition(...) as dag: pass

Operators

Dummy Operator

Before Migration After Migration
from airflow.operators.dummy_operator import DummyOperator from pydolphinscheduler.tasks.shell import Shell
from airflow.operators.dummy import DummyOperator from pydolphinscheduler.tasks.shell import Shell
dummy = DummyOperator(...) dummy = Shell(..., command="echo 'airflow dummy operator'")

Shell Operator

Before Migration After Migration
from airflow.operators.bash import BashOperator from pydolphinscheduler.tasks.shell import Shell
bash = BashOperator(...) bash = Shell(...)

Spark Sql Operator

Before Migration After Migration
from airflow.operators.spark_sql_operator import SparkSqlOperator from pydolphinscheduler.tasks.sql import Sql
spark = SparkSqlOperator(...) spark = Sql(...)

Python Operator

Before Migration After Migration
from airflow.operators.python_operator import PythonOperator from pydolphinscheduler.tasks.python import Python
python = PythonOperator(...) python = Python(...)

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

airphin-0.0.8.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

airphin-0.0.8-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file airphin-0.0.8.tar.gz.

File metadata

  • Download URL: airphin-0.0.8.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for airphin-0.0.8.tar.gz
Algorithm Hash digest
SHA256 28c385c0019334199ef29ecc8290e594637f17df73c38fb34d54003f18b508f3
MD5 8a7ff54175db9eaf0cc2b39d0bbb0891
BLAKE2b-256 450e8e7854baf1e4766be72bb0dbe99bf307fd4d33b9906a2562cb7242fed24d

See more details on using hashes here.

File details

Details for the file airphin-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: airphin-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for airphin-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0416bf293351087d2cc61361764d3f2d7f95f253e515e8c14a4019fcfec4a2e7
MD5 a20d27147d7e539a3a1c41f28312e9c4
BLAKE2b-256 bee707737c36e1c5f9f150603617b3d1e26b5b1b9a9e39546651c882931108ba

See more details on using hashes here.

Supported by

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