Skip to content

Commit 77c47d2

Browse files
committed
added doc string
1 parent c6922cf commit 77c47d2

File tree

1 file changed

+24
-0
lines changed
  • metadata-ingestion/src/datahub/ingestion/source/tableau

1 file changed

+24
-0
lines changed

metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py

+24
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,30 @@ def _is_allowed_project(self, project: TableauProject) -> bool:
908908
return is_allowed
909909

910910
def _is_denied_project(self, project: TableauProject) -> bool:
911+
"""
912+
Why use an explicit denial check instead of the `AllowDenyPattern.allowed` method?
913+
914+
Consider a scenario where a Tableau site contains four projects: A, B, C, and D, with the following hierarchical relationship:
915+
916+
- **A**
917+
- **B** (Child of A)
918+
- **C** (Child of A)
919+
- **D**
920+
921+
In this setup:
922+
923+
- `project_pattern` is configured with `allow: ["A"]` and `deny: ["B"]`.
924+
- `extract_project_hierarchy` is set to `True`.
925+
926+
The goal is to extract assets from project A and its children while explicitly denying the child project B.
927+
928+
If we rely solely on the `project_pattern.allowed()` method, project C's assets will not be ingested.
929+
This happens because project C is not explicitly included in the `allow` list, nor is it part of the `deny` list.
930+
However, since `extract_project_hierarchy` is enabled, project C should ideally be included in the ingestion process unless explicitly denied.
931+
932+
To address this, the function explicitly checks the deny regex to ensure that project C’s assets are ingested if it is not specifically denied in the deny list. This approach ensures that the hierarchy is respected while adhering to the configured allow/deny rules.
933+
"""
934+
911935
# Either project_pattern or project_path_pattern is set in a recipe
912936
# TableauConfig.projects_backward_compatibility ensures that at least one of these properties is configured.
913937

0 commit comments

Comments
 (0)