Airphin is a tool for migrating Airflow DAGs to DolphinScheduler Python API.
Project description
Airphin
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
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
File details
Details for the file airphin-0.0.9.tar.gz
.
File metadata
- Download URL: airphin-0.0.9.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6164ce54d8ecec9fcff0fc423d575ff766d801f855943c09d944f0eb3688a55 |
|
MD5 | ed1593d835d64c19c9de68294139beba |
|
BLAKE2b-256 | c3f90f8d6942e87d142493bad2ec4e4af9cc1d7798821d1205dfe0d49acc72af |
File details
Details for the file airphin-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: airphin-0.0.9-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7623a3b7b07bef95898defbcfa0027aec7ce55d44474467d5868c97508188df |
|
MD5 | 413e12a45d80c83b95bef65f0172184d |
|
BLAKE2b-256 | 96683797586cbcf9653adb90f950eca2ea93d0fdef76174eaf7a0d4cddaf4be5 |