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(...) |
Release files for airphin 0.0.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| airphin-0.0.13.tar.gz | 20.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| airphin-0.0.13-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.9 kB
Release files / airphin-0.0.13.tar.gz
| Download URL | airphin-0.0.13.tar.gz |
|---|---|
| Size | 20.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63300730fa7bc9e56a766a58a859364f86b80e6a96ef7f0f16f4632f886754da
|
|
BLAKE2b-256 checksum How to use checksums |
8bffeeade5c8f2a450f4b3ef40d4fa2b86527e20d4f05c85857139190a4bc2c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.2
|
Release files / airphin-0.0.13-py3-none-any.whl
| Download URL | airphin-0.0.13-py3-none-any.whl |
|---|---|
| Size | 26.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7760d7684edfa9cf40228f17db981cc375338fbbcb2a229896d7edbbd13ac44e
|
|
BLAKE2b-256 checksum How to use checksums |
a21204696b124f6149e382f935537b6a0c2be6457e63904b1cef8eb720ced0a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.2
|