Skip to content

Commit

Permalink
fix(snowflake): user_email_pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
sgomezvillamor committed Jan 31, 2025
1 parent bde5c73 commit 36a752b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,11 @@ def aggregate_event(
resource=resource,
),
).add_read_entry(
user,
query,
fields,
user_email=user,
query=query,
fields=fields,
count=count,
user_email_pattern=self.config.user_email_pattern,
)

def generate_workunits(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,15 @@ def add(
TableSwap,
],
) -> None:
if (
isinstance(item, PreparsedQuery | ObservedQuery)
and item.user
and self.usage_config
and not self.usage_config.user_email_pattern.allowed(item.user.urn())
):
logger.info(f"Skipping query from user: {item.user}")
return

Check warning on line 594 in metadata-ingestion/src/datahub/sql_parsing/sql_parsing_aggregator.py

View check run for this annotation

Codecov / codecov/patch

metadata-ingestion/src/datahub/sql_parsing/sql_parsing_aggregator.py#L593-L594

Added lines #L593 - L594 were not covered by tests

if isinstance(item, KnownQueryLineageInfo):
self.add_known_query_lineage(item)
elif isinstance(item, KnownLineageMapping):
Expand Down

0 comments on commit 36a752b

Please sign in to comment.