Skip to content

fix: Don't retrieve column lineage when it is not enabled #1956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions frontend/amundsen_application/static/.betterer.results
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ exports[`eslint`] = {
"js/components/Tags/index.tsx:3468508233": [
[38, 4, 21, "Must use destructuring props assignment", "4236634811"]
],
"js/config/config-default.ts:2726844505": [
[381, 6, 21, "\'partitionKey\' is defined but never used.", "399589312"],
[382, 6, 23, "\'partitionValue\' is defined but never used.", "793372348"]
"js/config/config-default.ts:1828402213": [
[382, 6, 21, "\'partitionKey\' is defined but never used.", "399589312"],
[383, 6, 23, "\'partitionValue\' is defined but never used.", "793372348"]
],
"js/ducks/announcements/index.spec.ts:1898496537": [
[3, 0, 148, "\`.\` import should occur after import of \`./types\`", "4154971894"]
Expand Down Expand Up @@ -643,9 +643,9 @@ exports[`eslint`] = {
"js/pages/TableDetailPage/WatermarkLabel/index.tsx:2189911402": [
[29, 22, 21, "Must use destructuring props assignment", "587844958"]
],
"js/pages/TableDetailPage/index.tsx:833718545": [
[162, 2, 20, "key should be placed after componentWillUnmount", "3916788587"],
[215, 6, 13, "Do not use setState in componentDidUpdate", "57229240"]
"js/pages/TableDetailPage/index.tsx:3561497819": [
[163, 2, 20, "key should be placed after componentWillUnmount", "3916788587"],
[216, 6, 13, "Do not use setState in componentDidUpdate", "57229240"]
],
"js/utils/textUtils.ts:2545492889": [
[19, 6, 46, "Unexpected lexical declaration in case block.", "156477898"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ describe('TableDetail', () => {
describe('when preExpandRightPanel is called when a column is preselected', () => {
it('column lineage is populated and selected column details are set in the state', () => {
setStateSpy.mockClear();
jest
.spyOn(ConfigUtils, 'isColumnListLineageEnabled')
.mockImplementation(() => true);

const { props, wrapper } = setup();
wrapper.instance().preExpandRightPanel(mockColumnDetails);

Expand All @@ -199,6 +203,10 @@ describe('TableDetail', () => {
describe('when toggleRightPanel is called while the panel is closed', () => {
it('column lineage is populated and selected column details are set in the state', () => {
setStateSpy.mockClear();
jest
.spyOn(ConfigUtils, 'isColumnListLineageEnabled')
.mockImplementation(() => true);

const { props, wrapper } = setup();
wrapper.setState({ isRightPanelOpen: false });
wrapper.instance().toggleRightPanel(mockColumnDetails);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
indexDashboardsEnabled,
issueTrackingEnabled,
isTableListLineageEnabled,
isColumnListLineageEnabled,
notificationsEnabled,
isTableQualityCheckEnabled,
} from 'config/config-utils';
Expand Down Expand Up @@ -323,7 +324,7 @@ export class TableDetail extends React.Component<
let key = '';
if (columnDetails) {
({ key } = columnDetails);
if (!columnDetails.isNestedColumn) {
if (isColumnListLineageEnabled() && !columnDetails.isNestedColumn) {
const { name, tableParams } = columnDetails;
getColumnLineageDispatch(buildTableKey(tableParams), name);
}
Expand Down Expand Up @@ -352,6 +353,7 @@ export class TableDetail extends React.Component<
(key && key !== selectedColumnKey) || !isRightPanelOpen;

if (
isColumnListLineageEnabled() &&
shouldPanelOpen &&
newColumnDetails &&
!newColumnDetails.isNestedColumn
Expand Down