feat(catalog): add load_lineage_documents() to DataHubCatalogLoader#214
Merged
seyoung4503 merged 3 commits intomasterfrom Feb 28, 2026
Merged
feat(catalog): add load_lineage_documents() to DataHubCatalogLoader#214seyoung4503 merged 3 commits intomasterfrom
seyoung4503 merged 3 commits intomasterfrom
Conversation
build_table_metadata()를 활용하여 DataHub의 upstream/downstream 테이블 lineage와 컬럼 단위 lineage를 TextDocument로 변환한다. EnrichedNL2SQL의 documents 파라미터에 전달하면 VectorRetriever가 lineage 컨텍스트를 SQL 생성 시 참조할 수 있다. - _urn_to_lineage_document(): URN별 변환 로직 분리 - _format_lineage(): 자연어 텍스트 포맷 정적 메서드로 분리 - 사이클 안전성은 하위 레이어(min_degree_lineage, degree 필터)에 위임 - lineage 없는 테이블은 자동 제외
…rit it core/ports.py에 CatalogLoaderPort Protocol을 추가하고 DataHubCatalogLoader가 이를 명시적으로 상속하도록 수정한다. 다른 Integration(LLMPort, EmbeddingPort, DBPort 등)과 동일한 패턴을 적용한다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣ Issue Number
📝 요약(Summary)
DataHubCatalogLoader에load_lineage_documents()메서드를 추가하여 DataHub의 테이블·컬럼 단위lineage를
TextDocument로 변환한다.EnrichedNL2SQL의documents파라미터에 전달하면VectorRetriever가 lineage 컨텍스트를 인덱싱하여SQL 생성 시 참조할 수 있다.
_format_lineage()정적 메서드로, URN별 변환은_urn_to_lineage_document()로분리하여
load_lineage_documents()를 단순하게 유지한다.💬 To Reviewers (선택)
DataHubCatalogLoader에서 별도로 구현하지 않고 하위레이어(
get_table_lineage()의 GraphQL degree 필터,min_degree_lineage()의 dict dedup,build_table_metadata()의 self-exclusion)에 위임합니다. 실제 DataHub 환경에서도 충분한지 확인부탁드립니다.
max_degree기본값: 현재 2로 설정되어 있어 직접 연결(depth 1) + 1단계 확장(depth 2)까지포함합니다. 실제 그래프 규모에 따라 조회 시간이 길어질 수 있으므로 적절한 기본값인지 의견 부탁드립니다.
CatalogEntry와의 분리: lineage는CatalogEntry에 포함하지 않고TextDocument로 분리하여DataHub 없이도
CatalogEntry를 사용할 수 있도록 설계했습니다.PR Checklist
필요)
pytest tests/— 145 passed, 6 skipped)load_lineage_documents()docstring에 사용 예시 포함reference) How to Code Review