Skip to main content

Apache Airflow scheduler adapter for Datus

Project description

datus-scheduler-airflow

Apache Airflow scheduler adapter for Datus.

Install

pip install datus-scheduler-airflow

Quick Start

from datus_airflow import AirflowSchedulerAdapter
from datus_scheduler_core.config import AirflowConfig
from datus_scheduler_core.models import SchedulerJobPayload

config = AirflowConfig(
    name="airflow_prod",
    type="airflow",
    api_base_url="http://localhost:8080/api/v1",
    username="admin",
    password="admin",
    dags_folder="/opt/airflow/dags",
)

adapter = AirflowSchedulerAdapter(config)
adapter.test_connection()

job = adapter.submit_job(SchedulerJobPayload(
    job_name="daily_report",
    sql="SELECT count(*) FROM orders",
    db_connection={"url": "postgresql://user:pass@host/db"},
    schedule="0 8 * * *",
))
print(job.job_id)

Integration Tests

# Start Airflow (docker-compose lives next to the tests)
cd tests/integration
docker compose up -d
cd ../..

# Run tests (from the workspace root; AIRFLOW_PASSWORD matches
# _AIRFLOW_WWW_USER_PASSWORD in tests/integration/docker-compose.yml)
AIRFLOW_PASSWORD=admin uv run pytest tests/integration/ -v -m integration

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

datus_scheduler_airflow-0.1.4.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

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

datus_scheduler_airflow-0.1.4-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file datus_scheduler_airflow-0.1.4.tar.gz.

File metadata

  • Download URL: datus_scheduler_airflow-0.1.4.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for datus_scheduler_airflow-0.1.4.tar.gz
Algorithm Hash digest
SHA256 dd2e95f4daf09ea6b382d868d3d909becf3cd2905fad2fa018e71895ec65bb3e
MD5 96051deb7966102735f82b328e77833f
BLAKE2b-256 136c4635748ee5666c57121f92c1c549dcea665c2fd3481f4a25f9dd2adcf296

See more details on using hashes here.

File details

Details for the file datus_scheduler_airflow-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for datus_scheduler_airflow-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9114e423a2d5b63833f88948b747ecba5232c1fae13a1caf40ca16cc25aaf623
MD5 0eb45e740f904c9aeddb169f7df0f8cb
BLAKE2b-256 8beb03313e526a42a4f2ea8fea79f8fa2b4eafd58acc67348241372c1de1777d

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