datahub-airflow-plugin-lite
Airflow 실행 메타데이터와 lineage를 DataHub로 보내는 런타임 의존성 0개 플러그인입니다. 표준 라이브러리와 이미 설치된 Airflow만 사용하므로 MWAA 등 Airflow constraints 파일과 충돌하지 않습니다.
| 항목 | 지원 범위 | 검증한 조합 |
|---|---|---|
| Python | 3.9 이상 | 3.9.6, 3.12.13 |
| Airflow | 2.9.1 이상 (3.x 포함) | 2.9.1, 2.11.2, 3.1.0 |
| DataHub GMS | 1.4.0.3 이상 | URN/aspect를 acryl-datahub 1.4.0.3 SDK 출력과 대조 |
설치
pip install datahub-airflow-plugin-lite-0.1.3-py3-none-any.whl
공식 플러그인(acryl-datahub-airflow-plugin)과 동시에 설치하지 마세요. 두 리스너가 같은 엔티티를 중복 전송합니다.
설정
airflow.cfg의 [datahub] 섹션(또는 AIRFLOW__DATAHUB__* 환경변수)을 읽습니다. 키 이름은 공식 플러그인과 같습니다.
[datahub]
# GMS 주소/토큰을 직접 지정하거나, 생략하면 conn_id 커넥션(host=GMS URL, password=토큰)을 사용
gms_url = https://datahub-gms.example.com
token = <personal access token>
conn_id = datahub_rest_default
cluster = prod
platform_instance =
capture_ownership_info = true
capture_ownership_as_group = false
capture_tags_info = true
capture_executions = true
materialize_iolets = true
capture_airflow_assets = true
enable_datajob_lineage = true
enable_openlineage_facets = true
openlineage_timeout_sec = 5
supplement_with_sql_parser = true
athena_include_result_location = false
dag_filter_str = {"allow": [".*"], "deny": []}
timeout_sec = 10
retries = 2
ssl_verify = true
운영 스위치도 공식 플러그인과 같습니다.
AIRFLOW_VAR_DATAHUB_AIRFLOW_PLUGIN_DISABLE_LISTENER=true: 리스너 즉시 중지 (kill switch)DATAHUB_AIRFLOW_PLUGIN_RUN_IN_THREAD,DATAHUB_AIRFLOW_PLUGIN_RUN_IN_THREAD_TIMEOUT: 백그라운드 스레드 실행 여부와 대기 시간
동작
| Airflow 이벤트 | 전송 내용 |
|---|---|
| DAG run 시작 | DataFlow (dataFlowInfo, status, browsePathsV2, ownership, globalTags, dataPlatformInstance), 태스크·태그 status |
| 태스크 시작 | DataJob (dataJobInfo, status, ownership, globalTags), 실행 기록 (dataProcessInstance*, STARTED) |
| 태스크 성공/실패 | DataJob + dataJobInputOutput(lineage), 실행 결과(COMPLETE, SUCCESS/FAILURE), 실행 입출력, 데이터셋 status |
전송은 GMS의 POST /aspects?action=ingestProposal 하나만 사용합니다.
모든 처리는 데몬 스레드에서 실행되고, 예외는 로그로만 남기므로 태스크 실패로 이어지지 않습니다.
Lineage 소스
inlets/outlets의Dataset/Urn객체 또는urn:li:...문자열datahub_airflow_plugin_lite.entities.Dataset/Urn- 공식 플러그인의
datahub_airflow_plugin.entities객체도urn속성이 있어 그대로 인식합니다.
- Airflow 네이티브 Dataset(2.x)/Asset(3.x). URI 스킴으로 플랫폼을 판별합니다.
- OpenLineage provider (기본 소스): operator의
get_openlineage_facets_on_complete/start()결과를 사용합니다. 몽키패치는 하지 않습니다.- 정규화: provider 버전마다 다른 결과를 DataHub ingestion URN으로 맞춥니다(
ol_normalize.py).- Athena:
AwsDataCatalog.접두어를 제거하고 소문자로 바꿉니다. - S3: 버킷과 키를 합쳐
make_s3_urn과 같은 규칙을 적용합니다. - Snowflake: 소문자로 바꿉니다.
- Athena:
- 버전 의존 값 제거: 버전마다 다르게 나오는 Athena 쿼리 결과 위치는 제외합니다.
- 시간 제한: OpenLineage 호출은
openlineage_timeout_sec(기본 5초)까지만 기다립니다.
- 정규화: provider 버전마다 다른 결과를 DataHub ingestion URN으로 맞춥니다(
- 내장 SQL 파서 (보완): OpenLineage가 버전에 따라 놓친 테이블을 채웁니다. 예: provider 2.x의 CTE 입력 누락, amazon 8.x의 Athena 테이블 누락. 이 단계는 OpenLineage 결과를 지우지 않습니다.
- DB에 접속하지 않고 SQL 문과 Connection 정보(conn_type, 기본 DB/스키마)만 사용합니다.
lineage 수집이 실패해서 결과가 불완전할 수 있으면 dataJobInputOutput을 보내지 않습니다. 이미 저장된 lineage를 덮어쓰지 않기 위해서입니다. 예: OpenLineage가 실패했고 SQL도 분석할 수 없는 경우.
DataJob 정보와 실행 기록은 lineage보다 먼저 전송하므로, lineage 수집 결과와 관계없이 항상 기록됩니다.
provider 1.7.0, 2.11.0, 2.20.2에서 같은 lineage가 저장되는지 비교한 결과는 tests/compat/README.md에 있습니다.
공식 플러그인과의 차이
URN 생성 규칙(DataFlow, DataJob, Dataset, DataProcessInstance)은 공식 플러그인과 같습니다. 따라서 공식 플러그인에서 전환해도 엔티티가 중복 생성되지 않습니다.
tests/unit/test_sdk_parity.py가 이를 검증합니다.
| 기능 | 공식 | lite |
|---|---|---|
| DataFlow/DataJob/실행 이력, 소유자, 태그 | O | O |
| inlets/outlets, Airflow Dataset/Asset lineage | O | O |
| OpenLineage 기반 테이블 lineage | O (SQL 파서 패치) | O (패치 없이 결과 정규화 + 내장 SQL 파서 보완) |
| 컬럼 단위 lineage (DataHub SQL 파서) | O | X |
| Kafka/File emitter, 다중 커넥션 | O | X (REST만) |
Datahub_Cleanup DAG, DatahubEmitterOperator, assertion sensor |
O | X |
| Jinja 템플릿 렌더링 후 속성 수집 | O | X (원본 값 사용) |
개발
pip install -e ".[dev]"
pytest
test_sdk_parity.py는 acryl-datahub가 설치된 경우에만 실행됩니다. test_listener.py는 설치된 Airflow의 실제 listener manager(pluggy)에 등록해 훅 시그니처 호환성을 검증합니다.
Metadata
Release files for datahub-airflow-plugin-lite 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datahub_airflow_plugin_lite-0.1.3.tar.gz | 30.4 kB | Without provenance | Details for datahub_airflow_plugin_lite-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datahub_airflow_plugin_lite-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for datahub_airflow_plugin_lite-0.1.3-py3-none-any.whl |
Total release size: 63.5 kB
Release files / datahub_airflow_plugin_lite-0.1.3.tar.gz
| Download URL | datahub_airflow_plugin_lite-0.1.3.tar.gz |
|---|---|
| Size | 30.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bcbb1a5a597909c69c920c583ca0baaccd8e2f06dcb0780eed0ec76f5c4ef6b1
|
|
BLAKE2b-256 checksum How to use checksums |
fec2dd3e7c1973d7909dfe8c881c80a480a09b7fe2e11dbeb7c79105fba8afc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / datahub_airflow_plugin_lite-0.1.3-py3-none-any.whl
| Download URL | datahub_airflow_plugin_lite-0.1.3-py3-none-any.whl |
|---|---|
| Size | 33.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab52e7c990f043c23551f4d72d9f1e006d62a38a06448c7bd708e3a6709bd212
|
|
BLAKE2b-256 checksum How to use checksums |
7400edc52f8403e08d0e1ce72e46efe59a2917e0e5b07916a5bd2008f5e23946
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for datahub-airflow-plugin-lite 0.1.3
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.