Skip to main content

The Apache Airflow provider package for TDengine built by SCIA IoT.

Project description

Airflow TDengine Provider

Tests CodeQL Advanced Package

The Airflow Provider for TDengine.

Usage

Build the package locally, and install it on your Airflow environment.

pip install dist/sciaiot_airflow_providers_tdengine-0.1.2-py3-none-any.whl

Or via PyPI:

pip install sciaiot-airflow-providers-tdengine

Add a connection to Airflow via CLI:

airflow connections add 'tdengine_default' --conn-uri 'tdengine://root:taosdata@tdengine:6030'

Test it:

airflow connections test tdengine_default

NOTICE: The client driver taosc must be installed since only native connector i.e. tdengine is supported now.

Sample Operator

from sciaiot.airflow.providers.tdengine.operators.tdengine import BaseTDengineOperator


class CustomTDengineOperator(BaseOperator):
  def __init__(self, *, **kwargs) -> None:
    super().__init__(conn_id=conn_id, database=database, **kwargs)

  def execute(self, context: Context) -> None:
    statement = "SELECT server_status()"
    hook = self.get_hook()
    hook.run(statement=statement)
  

Development

IDE

Use devcontainer with VS Code.

Database

Run the tests/DDL.sql in taos CLI to setup a test database.

Code Style

In the root folder of project, run:

# add -v for verbose output
# add --fix for auto fixing
ruff check 

Or with the Ruff extension installed, run commands for any opening python file.

Type Check

In the root folder of project, run:

mypy .

Install

In the root folder of project, run:

pip install -e .

Test

In the root folder of project, run:

pytest .

Build

Add build package:

pip install build

In the root folder of project, run:

python -m build

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

sciaiot_airflow_providers_tdengine-0.1.6.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file sciaiot_airflow_providers_tdengine-0.1.6.tar.gz.

File metadata

File hashes

Hashes for sciaiot_airflow_providers_tdengine-0.1.6.tar.gz
Algorithm Hash digest
SHA256 c6bc9e8e2fa77440294505c084695836cbde18a9117dae65a28acf037e6c0735
MD5 d7f4b3d4ea29cc267fcd2e2f4cfc15ed
BLAKE2b-256 608e7fbf32eb8e8b772e6d4949ea25abc9c8cc9aa94df4fa97065f7dfc1ff967

See more details on using hashes here.

Provenance

The following attestation bundles were made for sciaiot_airflow_providers_tdengine-0.1.6.tar.gz:

Publisher: package.yml on scia-iot/airflow-providers-tdengine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sciaiot_airflow_providers_tdengine-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for sciaiot_airflow_providers_tdengine-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 60e813b507ad2f11a7f112f0b4bfc9e4c59162ccae3176ad0c1e3823f3a8aa0b
MD5 2ba137359a54bf4d7168ec342adcbf0c
BLAKE2b-256 9e664ebf6f6ef8a7250f78af4b3d3bebb53a8dd9fa80a27c948c06b29b36a4b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sciaiot_airflow_providers_tdengine-0.1.6-py3-none-any.whl:

Publisher: package.yml on scia-iot/airflow-providers-tdengine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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