Skip to content

Commit

Permalink
Merge branch 'datahub-project:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker authored May 23, 2024
2 parents 8c8127f + 1544a60 commit d9d4c96
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -830,10 +830,10 @@ public GraphQLEngine.Builder builder() {
builder
.addDataLoaders(loaderSuppliers(loadableTypes))
.addDataLoader("Aspect", context -> createDataLoader(aspectType, context))
.configureRuntimeWiring(this::configureRuntimeWiring)
.setGraphQLQueryComplexityLimit(graphQLQueryComplexityLimit)
.setGraphQLQueryDepthLimit(graphQLQueryDepthLimit)
.setGraphQLQueryIntrospectionEnabled(graphQLQueryIntrospectionEnabled);
.setGraphQLQueryIntrospectionEnabled(graphQLQueryIntrospectionEnabled)
.configureRuntimeWiring(this::configureRuntimeWiring);
return builder;
}

Expand Down
11 changes: 11 additions & 0 deletions metadata-ingestion/src/datahub/ingestion/source/slack/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class CorpUser:
title: Optional[str] = None
image_url: Optional[str] = None
phone: Optional[str] = None
real_name: Optional[str] = None
slack_display_name: Optional[str] = None


class SlackSourceConfig(ConfigModel):
Expand Down Expand Up @@ -144,6 +146,12 @@ def get_user_info(self) -> Iterable[MetadataWorkUnit]:
corpuser_editable_info.pictureLink = user_obj.image_url
if user_obj.phone:
corpuser_editable_info.phone = user_obj.phone
if (
not corpuser_editable_info.displayName
or corpuser_editable_info.displayName == corpuser_editable_info.email
):
# let's fill out a real name
corpuser_editable_info.displayName = user_obj.real_name
yield MetadataWorkUnit(
id=f"{user_obj.urn}",
mcp=MetadataChangeProposalWrapper(
Expand Down Expand Up @@ -259,6 +267,9 @@ def populate_user_profile(self, user_obj: CorpUser) -> None:
user_obj.title = user_profile.get("title")
user_obj.image_url = user_profile.get("image_192")
user_obj.phone = user_profile.get("phone")
user_obj.real_name = user_profile.get("real_name")
user_obj.slack_display_name = user_profile.get("display_name")

except Exception as e:
if "missing_scope" in str(e):
if self._use_users_info:
Expand Down

0 comments on commit d9d4c96

Please sign in to comment.