Skip to main content

An Airflow provider to connect to SAP HANA

Project description

Airflow SAP HANA Provider

This packages enables Airflow to connect to SAP HANA using the official SAP Database cursor hdbcli. This allows you to use the built-in Airflow operators and database hook methods, including methods that interact with SQLAlchemy, via sqlalchemy-hana.

Table of Contents generated with DocToc

Installing airflow-provider-sap-hana

pip install airflow-provider-sap-hana

Setting Up the Airflow/HANA Express Environment

This repository includes a docker-compose file designed to quickly set up an environment with everything needed to run the example DAG. The docker-compose file is based on the file provided in the Airflow quick-start guide but with several key modifications.

  • An additional service hana-express - This creates a SAP HANA Express instance, a tenant database named HXE, and a schema named 'AIRFLOW'

  • Additional environment variable AIRFLOW_CONN_HANA_DEFAULT which contains the URI needed to connect to the HANA express instance.

  • A custom Dockerfile to extend Airflow to include airflow-provider-sap-hana and Faker, to generate the mock data for the DAG.

The Airflow quick-start guide and the original docker-compose file can be found here Running Airflow in Docker

Initializing Airflow

The following directories and environment files need to be created before you initialize Airflow.

mkdir -p ./dags ./logs ./plugins ./config
echo -e "AIRFLOW_UID=$(id -u)" > .env

To initialize Airflow, run.

docker compose up airflow-init

After initialization is complete, you should see a message like this:

airflow-init_1       | Upgrades done
airflow-init_1       | Admin user airflow created
airflow-init_1       | 2.10.5
start_airflow-init_1 exited with code 0

Starting HANA Express

Before you start HANA Express, you need to create a directory to persist data outside the container and grant it the proper permissions.

mkdir -p ./hana
sudo chown 12000:79 ./hana

To start hana-express, run.

docker compose up hana-express -d

If you want to have visibility to the start-up process, run.

docker compose up hana-express -d && docker logs -f hana-express

This should take several minutes.

Start the Remaining Services

To start the remaining Airflow services, run.

docker compose up -d

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

airflow_provider_sap_hana-1.2.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

airflow_provider_sap_hana-1.2.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file airflow_provider_sap_hana-1.2.0.tar.gz.

File metadata

File hashes

Hashes for airflow_provider_sap_hana-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e833899c1f8c2663e25fd84096f0fc3437863026e7373acf1dc557087684a11f
MD5 a0e10bf085d211fd3b1dd5598f1b25b8
BLAKE2b-256 3bf560a6de68c71302fc7996f5cc2910789ebbfae08187ce8500ca0c6269de6b

See more details on using hashes here.

File details

Details for the file airflow_provider_sap_hana-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_provider_sap_hana-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9949adc37af79dee4f4cb13c8cf1583e3a68dda2b92e2d7c2f645edfcefb7c83
MD5 6e1e77f8c1e16420786afb38a50df2c3
BLAKE2b-256 deaefdecd59852f7c61e07a03373c587dfbaa1876e297b9bebd1962d8f440a57

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