Skip to main content

apache-airflow-providers-sktvane

  • AIDP 가 제공하는 자원들에 접근하는 용도
    • NES
    • BigQuery
    • Vault
  • 기타 공용 목적의 코드

PyPI

Environments

Local

  • VAULT_TOKEN 은 관련 문서 에서 확인
    export VAULT_ADDR=https://vault-public.sktai.io
    export VAULT_TOKEN={{VAULT_TOKEN}}
    export AIRFLOW__CORE__DAGS_FOLDER=.
    

Deployment

  • main 브랜치에 push 이벤트 발생 시 배포, 부득이하게 로컬 환경에서 배포할 경우 아래 명령 수행
    # build
    $ python setup.py sdist bdist_wheel
    # upload
    $ twine upload dist/*
    # remove
    $ rm -rf build dist apache_airflow_providers_sktvane.egg-info 
    

Components

Operators
  • airflow.providers.sktvane.operators.nes.NesOperator : AIDP 의 NES 사용
    from airflow.providers.sktvane.operators.nes import NesOperator
    
    ...
    
    NesOperator(
        task_id="jupyter_daily_count",
        input_nb="https://github.com/sktaiflow/notebooks/blob/master/statistics/jupyter_daily_count.ipynb",
        parameters={"current_date": "{{ ds }}", "channel": "#aim-statistics"},
    )
    
Sensors
  • airflow.providers.sktvane.sensors.gcp.BigqueryPartitionSensor : AIDP 의 BigQuery 파티션 체크

    from airflow.providers.sktvane.sensors.gcp import BigqueryPartitionSensor
    
    ...
    
    BigqueryPartitionSensor(
        task_id=f"{table}_partition_sensor",
        dataset_id="wind_tmt",
        table_id=table,
        partition="dt = '{{ds}}'",
    )
    
Macros
  • airflow.providers.sktvane.macros.slack.send_fail_message : AIDP 정의 포맷으로 Slack 에러 메시지 발송

    from airflow.providers.sktvane.macros.slack import send_fail_message
    
    ...
    
    def send_aidp_fail_message(slack_email: str) -> None:
      send_fail_message(
        slack_channel="#aidp-airflow-monitoring",
        slack_username=f"Airflow-AlarmBot-{env}",
        slack_email=slack_email,
      )
    
  • airflow.providers.sktvane.macros.gcp.bigquery_client : AIDP 의 BigQuery 사용

    from airflow.providers.sktvane.macros.gcp import bigquery_client
    
    ...
    
    def bq_query_to_bq(query, dest_table_name, **kwarg):
      bq_client = bigquery_client()
      job = bq_client.query(query)
      job.result()
    
  • airflow.providers.sktvane.macros.vault.get_secrets : AIDP 의 Vault 사용

    from airflow.providers.sktvane.macros.vault import get_secrets
    
    ...
    
    def get_hive_conn():
      from pyhive import hive
    
      hiveserver2 = get_secrets(path="ye/hiveserver2")
      host = hiveserver2["ip"]
      port = hiveserver2["port"]
      user = hiveserver2["user"]
      conn = hive.connect(host, port=port, username=user)
      return conn
    
  • airflow.providers.sktvane.macros.date.ds_nodash_plus_days : AIDP 에서 제공하는 date 유틸리티

    from airflow.providers.sktvane.macros.date import ds_nodash_plus_days
    
    ...
    
    def ds_nodash_tomorrow(ds):
        ds_nodash_plus_days(ds, 1)
    
  • airflow.providers.sktvane.macros.date.ds_nodash_minus_days : ds_nodash_plus_days 와 동일

  • airflow.providers.sktvane.macros.date.ym_nodash_add_month : ds_nodash_plus_days 와 동일

  • airflow.providers.sktvane.macros.date.first_day_of_this_month : ds_nodash_plus_days 와 동일

  • airflow.providers.sktvane.macros.date.last_day_of_this_month : ds_nodash_plus_days 와 동일

  • airflow.providers.sktvane.macros.date.get_latest_loaded_dt : ds_nodash_plus_days 와 동일

Metadata

Release files for apache-airflow-providers-sktvane 1.2.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apache-airflow-providers-sktvane 1.2.15
File Size Uploaded Provenance Actions
apache_airflow_providers_sktvane-1.2.15.tar.gz 12.8 kB Without provenance Details for apache_airflow_providers_sktvane-1.2.15.tar.gz

Release files / apache_airflow_providers_sktvane-1.2.15.tar.gz

Download URL apache_airflow_providers_sktvane-1.2.15.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
96a784103d4af1829555f22562113a603a899e8e143ee68aebfe45ad308cd661
BLAKE2b-256 checksum
How to use checksums
f5fe17b69bb94883b7243e58272eeadebd98d94edb20a4762fbe9f96d4c7deed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Security for apache-airflow-providers-sktvane 1.2.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.15 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page