Skip to content

Commit

Permalink
Merge branch 'master' into azure-support-delta-lake
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylJonny authored Nov 4, 2024
2 parents 2f4112b + 1f02c84 commit 9dd373f
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@octokit/plugin-throttling": "^3.5.1",
"@octokit/rest": "^18.6.2",
"@radix-ui/react-visually-hidden": "^1.0.2",
"@servicebell/widget": "^0.1.6",
"@supabase/supabase-js": "^2.33.1",
"@swc/core": "^1.4.2",
"antd": "^5.0.7",
Expand Down
9 changes: 8 additions & 1 deletion docs-website/src/pages/cloud/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import React, { useEffect, useState } from "react";
import Layout from "@theme/Layout";
import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
Expand All @@ -10,8 +10,11 @@ import UnifiedTabs from "./UnifiedTabs";
import FeatureCards from "./FeatureCards";
import Hero from "./Hero";
import DemoForm from "./DemoForm";
import ServiceBell from "@servicebell/widget";
import DemoFormModal from "./DemoFormModal";

const SERVICE_BELL_ID = "00892146e5bc46d98d55ecc2b2fa67e2";

function Home() {
const context = useDocusaurusContext();
const { siteConfig = {} } = context;
Expand All @@ -24,6 +27,10 @@ function Home() {
window.location.replace("/docs");
}

useEffect(() => {
ServiceBell("init", SERVICE_BELL_ID, { hidden: false });
}, []);

return !siteConfig.customFields.isSaas ? (
<Layout
title={'DataHub Cloud - Unify Data Observability, Governance and Discovery'}
Expand Down
6 changes: 5 additions & 1 deletion docs-website/src/theme/Footer/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import React from "react";
import { useLocation } from "react-router-dom"; // Import useLocation from react-router-dom
import Footer from "@theme-original/Footer";
import MarkpromptHelp from "../../components/MarkpromptHelp";

export default function FooterWrapper(props) {
const location = useLocation(); // Get the current location
const isDocsPage = location.pathname.startsWith("/docs"); // Check if the path starts with /docs

return (
<>
<MarkpromptHelp />
{isDocsPage && <MarkpromptHelp />}
<Footer {...props} />
</>
);
Expand Down
5 changes: 5 additions & 0 deletions docs-website/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2843,6 +2843,11 @@
rc-resize-observer "^1.3.1"
rc-util "^5.38.0"

"@servicebell/widget@^0.1.6":
version "0.1.6"
resolved "https://registry.yarnpkg.com/@servicebell/widget/-/widget-0.1.6.tgz#04672a7e7b14ff7025ec83fd740373345c359d74"
integrity sha512-Kh21FAETJlk32MRXHGYKxFTWLbbLlgLX3lKYH/02KHaQGIPRdHh/Ok7DiRc+/6f/OTQq3x3ady7e4o9weV5yQg==

"@sideway/address@^4.1.5":
version "4.1.5"
resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.5.tgz#4bc149a0076623ced99ca8208ba780d65a99b9d5"
Expand Down
11 changes: 11 additions & 0 deletions metadata-ingestion/src/datahub/cli/delete_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,17 @@ def references(urn: str, dry_run: bool, force: bool) -> None:
logger.info(f"Deleted {references_count} references to {urn}")


@delete.command()
@click.option("--urn", required=True, type=str, help="the urn of the entity")
def undo_by_filter(urn: str) -> None:
"""
Undo a soft deletion of an entity
"""
graph = get_default_graph()
logger.info(f"Using {graph}")
graph.set_soft_delete_status(urn=urn, delete=False)


@delete.command(no_args_is_help=True)
@click.option(
"--urn",
Expand Down
17 changes: 16 additions & 1 deletion metadata-ingestion/src/datahub/ingestion/graph/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1241,14 +1241,29 @@ def soft_delete_entity(
Args:
urn: The urn of the entity to soft-delete.
"""
self.set_soft_delete_status(
urn=urn, run_id=run_id, deletion_timestamp=deletion_timestamp, delete=True
)

def set_soft_delete_status(
self,
urn: str,
delete: bool,
run_id: str = _GRAPH_DUMMY_RUN_ID,
deletion_timestamp: Optional[int] = None,
) -> None:
"""Change status of soft-delete an entity by urn.
Args:
urn: The urn of the entity to soft-delete.
"""
assert urn

deletion_timestamp = deletion_timestamp or int(time.time() * 1000)
self.emit(
MetadataChangeProposalWrapper(
entityUrn=urn,
aspect=StatusClass(removed=True),
aspect=StatusClass(removed=delete),
systemMetadata=SystemMetadataClass(
runId=run_id, lastObserved=deletion_timestamp
),
Expand Down

0 comments on commit 9dd373f

Please sign in to comment.