Skip to content

Commit

Permalink
feat(ingest/mode): add option to exclude restricted
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal committed Aug 2, 2024
1 parent f78b6c0 commit 7cca059
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions metadata-ingestion/src/datahub/ingestion/source/mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,14 @@ class ModeConfig(StatefulIngestionConfigBase, DatasetLineageProviderConfigBase):
connect_uri: str = Field(
default="https://app.mode.com", description="Mode host URL."
)
token: str = Field(description="Mode user token.")
token: str = Field(
description="When creating workspace API key this is the 'Key ID'."
)
password: pydantic.SecretStr = Field(
description="Mode password for authentication."
description="When creating workspace API key this is the 'Secret'."
)
exclude_restricted: bool = Field(
default=False, description="Exclude restricted collections"
)

workspace: str = Field(
Expand Down Expand Up @@ -522,6 +527,11 @@ def _get_space_name_and_tokens(self) -> dict:
for s in spaces:
logger.debug(f"Space: {s.get('name')}")
space_name = s.get("name", "")
if s.get("restricted") and self.config.exclude_restricted:
logging.debug(
f"Skipping space {space_name} due to exclude restricted"
)
continue
if not self.config.space_pattern.allowed(space_name):
self.report.report_dropped_space(space_name)
logging.debug(f"Skipping space {space_name} due to space pattern")
Expand Down

0 comments on commit 7cca059

Please sign in to comment.