Skip to content

Commit

Permalink
feat: added optional in_amundsen bool to lineage items (#2010)
Browse files Browse the repository at this point in the history
* additional logging

Signed-off-by: Allison Suarez Miranda <[email protected]>

* feat: added optiona in_amundsen bool to lineage items

Signed-off-by: Allison Suarez Miranda <[email protected]>

* lint

Signed-off-by: Allison Suarez Miranda <[email protected]>

* prettier

Signed-off-by: Allison Suarez Miranda <[email protected]>

* remove dedbugging logging

Signed-off-by: Allison Suarez Miranda <[email protected]>

Signed-off-by: Allison Suarez Miranda <[email protected]>
  • Loading branch information
allisonsuarez authored Oct 18, 2022
1 parent 1e1b90c commit 73d7dc1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions common/amundsen_common/models/lineage.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class LineageItem:
usage: Optional[int] = None # statistic to sort lineage items by
parent: Optional[str] = None # key of the parent entity, used to create the relationships in graph
link: Optional[str] = None # internal link to redirect to different than the resource details page
in_amundsen: Optional[bool] = None # it is possible to have lineage that doesn't exist in Amundsen in that moment


class LineageItemSchema(AttrsSchema):
Expand Down
2 changes: 1 addition & 1 deletion common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from setuptools import find_packages, setup

__version__ = '0.28.0'
__version__ = '0.29.0'


requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements-dev.txt')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface LineageItem {
usage: number | null;
source?: string;
link?: string;
in_amundsen?: boolean;
}

export interface Lineage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ export interface LineageListProps {
}

const isTableLinkDisabled = (table: LineageItem) => {
// check if item is currently indexed in Amundsen, if it's not mark as disabled
if (table.in_amundsen === false) {
return true;
}

// use configuration to determine weather a table link is disabled or not
const disableAppListLinks = getTableLineageDisableAppListLinks();
let disabled = false;
if (disableAppListLinks) {
Expand All @@ -29,6 +35,7 @@ const isTableLinkDisabled = (table: LineageItem) => {
return disableAppListLinks![key].test(table[key]) === false;
});
}

return disabled;
};

Expand Down
2 changes: 1 addition & 1 deletion requirements-common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# It is recommended to always pin the exact version (not range) - otherwise common upgrade won't trigger unit tests
# on all repositories reyling on this file and any issues that arise from common upgrade might be missed.
amundsen-common>=0.27.0,<0.29.0
amundsen-common>=0.27.0,<0.30.0
attrs>=19.1.0
boto3==1.17.23
click==7.0
Expand Down

0 comments on commit 73d7dc1

Please sign in to comment.