Skip to content

Commit

Permalink
Merge branch 'master' into ps-ingestion-memory-profile
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro93 authored Oct 12, 2023
2 parents fb767de + 84bba4d commit ddad4b2
Show file tree
Hide file tree
Showing 56 changed files with 918 additions and 1,200 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,8 @@ private void configureCorpUserResolvers(final RuntimeWiring.Builder builder) {
*/
private void configureCorpGroupResolvers(final RuntimeWiring.Builder builder) {
builder.type("CorpGroup", typeWiring -> typeWiring
.dataFetcher("relationships", new EntityRelationshipsResultResolver(graphClient)));
.dataFetcher("relationships", new EntityRelationshipsResultResolver(graphClient))
.dataFetcher("exists", new EntityExistsResolver(entityService)));
builder.type("CorpGroupInfo", typeWiring -> typeWiring
.dataFetcher("admins",
new LoadableTypeBatchResolver<>(corpUserType,
Expand Down
5 changes: 5 additions & 0 deletions datahub-graphql-core/src/main/resources/entity.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3788,6 +3788,11 @@ type CorpGroup implements Entity {
Additional read only info about the group
"""
info: CorpGroupInfo @deprecated

"""
Whether or not this entity exists on DataHub
"""
exists: Boolean
}

"""
Expand Down
4 changes: 4 additions & 0 deletions datahub-web-react/src/app/entity/group/GroupProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { RoutedTabs } from '../../shared/RoutedTabs';
import GroupInfoSidebar from './GroupInfoSideBar';
import { GroupAssets } from './GroupAssets';
import { ErrorSection } from '../../shared/error/ErrorSection';
import NonExistentEntityPage from '../shared/entity/NonExistentEntityPage';

const messageStyle = { marginTop: '10%' };

Expand Down Expand Up @@ -110,6 +111,9 @@ export default function GroupProfile() {
urn,
};

if (data?.corpGroup?.exists === false) {
return <NonExistentEntityPage />;
}
return (
<>
{error && <ErrorSection />}
Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/graphql/group.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ query getGroup($urn: String!, $membersCount: Int!) {
urn
type
name
exists
origin {
type
externalType
Expand Down
2 changes: 2 additions & 0 deletions docs/how/updating-datahub.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This file documents any backwards-incompatible changes in DataHub and assists pe
### Breaking Changes

- #8810 - Removed support for SQLAlchemy 1.3.x. Only SQLAlchemy 1.4.x is supported now.
- #8942 - Removed `urn:li:corpuser:datahub` owner for the `Measure`, `Dimension` and `Temporal` tags emitted
by Looker and LookML source connectors.
- #8853 - The Airflow plugin no longer supports Airflow 2.0.x or Python 3.7. See the docs for more details.
- #8853 - Introduced the Airflow plugin v2. If you're using Airflow 2.3+, the v2 plugin will be enabled by default, and so you'll need to switch your requirements to include `pip install 'acryl-datahub-airflow-plugin[plugin-v2]'`. To continue using the v1 plugin, set the `DATAHUB_AIRFLOW_PLUGIN_USE_V1_PLUGIN` environment variable to `true`.
- #8943 The Unity Catalog ingestion source has a new option `include_metastore`, which will cause all urns to be changed when disabled.
Expand Down
9 changes: 9 additions & 0 deletions metadata-ingestion/src/datahub/ingestion/api/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from dataclasses import dataclass
from typing import TYPE_CHECKING, Dict, Generic, Iterable, Optional, Tuple, TypeVar

from datahub.configuration.common import ConfigurationError
from datahub.emitter.mce_builder import set_dataset_urn_to_lower
from datahub.ingestion.api.committable import Committable
from datahub.ingestion.graph.client import DataHubGraph
Expand Down Expand Up @@ -75,3 +76,11 @@ def register_checkpointer(self, committable: Committable) -> None:

def get_committables(self) -> Iterable[Tuple[str, Committable]]:
yield from self.checkpointers.items()

def require_graph(self, operation: Optional[str] = None) -> DataHubGraph:
if not self.graph:
raise ConfigurationError(
f"{operation or 'This operation'} requires a graph, but none was provided. "
"To provide one, either use the datahub-rest sink or set the top-level datahub_api config in the recipe."
)
return self.graph
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,9 @@ def __init__(self, config: CSVEnricherConfig, ctx: PipelineContext):
# Map from entity urn to a list of SubResourceRow.
self.editable_schema_metadata_map: Dict[str, List[SubResourceRow]] = {}
self.should_overwrite: bool = self.config.write_semantics == "OVERRIDE"
if not self.should_overwrite and not self.ctx.graph:
raise ConfigurationError(
"With PATCH semantics, the csv-enricher source requires a datahub_api to connect to. "
"Consider using the datahub-rest sink or provide a datahub_api: configuration on your ingestion recipe."
)

if not self.should_overwrite:
self.ctx.require_graph(operation="The csv-enricher's PATCH semantics flag")

def get_resource_glossary_terms_work_unit(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
DBTCommonConfig,
DBTNode,
DBTSourceBase,
DBTTest,
DBTTestResult,
)
from datahub.ingestion.source.dbt.dbt_tests import DBTTest, DBTTestResult

logger = logging.getLogger(__name__)

Expand Down
Loading

0 comments on commit ddad4b2

Please sign in to comment.