fix (frontend): Partially fixes lineage issues and dataset API handling (#1874)

* Initial fix for lineage graph

* Fixes broken test by lineage fix commit and returns empty response instead of 500 for upstreams
This commit is contained in:
Charlie Tran 2020-09-14 19:09:02 -07:00 committed by GitHub
parent 7c7de50be8
commit 84efa73098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 11 deletions

View File

@ -58,7 +58,7 @@ public class Dataset extends Controller {
return internalServerError(ControllerUtil.errorResponse(e)); return internalServerError(ControllerUtil.errorResponse(e));
} }
return ok(Json.newObject().set("dataset", Json.toJson(view))); return ok(Json.toJson(view));
} }
@Security.Authenticated(Secured.class) @Security.Authenticated(Secured.class)
@ -249,6 +249,11 @@ public class Dataset extends Controller {
try { try {
upstreams = _lineageDao.getUpstreamLineage(datasetUrn); upstreams = _lineageDao.getUpstreamLineage(datasetUrn);
} catch (Exception e) { } catch (Exception e) {
if (ControllerUtil.checkErrorCode(e, 404)) {
int[] emptyUpstreams = new int[0];
return ok(Json.toJson(emptyUpstreams));
}
Logger.error("Fetch Dataset upstreams error", e); Logger.error("Fetch Dataset upstreams error", e);
return internalServerError(ControllerUtil.errorResponse(e)); return internalServerError(ControllerUtil.errorResponse(e));
} }

View File

@ -148,25 +148,25 @@ export class DatasetEntity extends BaseEntity<Com.Linkedin.Dataset.Dataset> {
/** /**
* Whether or not the dataset has been deprecated * Whether or not the dataset has been deprecated
*/ */
@alias('entity.dataset.deprecated') @alias('entity.deprecated')
deprecated?: boolean; deprecated?: boolean;
/** /**
* Note attached to the deprecation process for this dataset * Note attached to the deprecation process for this dataset
*/ */
@alias('entity.dataset.deprecationNote') @alias('entity.deprecationNote')
deprecationNote?: string; deprecationNote?: string;
/** /**
* Timestamp for when the dataset was deprecated * Timestamp for when the dataset was deprecated
*/ */
@alias('entity.dataset.decommissionTime') @alias('entity.decommissionTime')
decommissionTime?: number; decommissionTime?: number;
/** /**
* Last timestamp for the modification of this dataset * Last timestamp for the modification of this dataset
*/ */
@oneWay('entity.dataset.modifiedTime') @oneWay('entity.modifiedTime')
modifiedTime?: number; modifiedTime?: number;
/** /**
@ -174,7 +174,7 @@ export class DatasetEntity extends BaseEntity<Com.Linkedin.Dataset.Dataset> {
* Note: This overrides the BaseEntity implementation since DatasetEntity has a different behavior than * Note: This overrides the BaseEntity implementation since DatasetEntity has a different behavior than
* other entities * other entities
*/ */
@oneWay('entity.dataset.removed') @oneWay('entity.removed')
removed!: boolean; removed!: boolean;
/** /**
@ -187,7 +187,7 @@ export class DatasetEntity extends BaseEntity<Com.Linkedin.Dataset.Dataset> {
/** /**
* Description for the dataset that contains more information about the nature of the data or metadata * Description for the dataset that contains more information about the nature of the data or metadata
*/ */
@oneWay('entity.dataset.description') @oneWay('entity.description')
description?: string; description?: string;
/** /**
@ -202,7 +202,7 @@ export class DatasetEntity extends BaseEntity<Com.Linkedin.Dataset.Dataset> {
/** /**
* Reference to the data entity, is the data platform to which the dataset belongs * Reference to the data entity, is the data platform to which the dataset belongs
*/ */
@computed('entity.dataset.platform', 'urn') @computed('entity.platform', 'urn')
get platform(): DatasetPlatform | undefined { get platform(): DatasetPlatform | undefined {
const { urn, entity } = this; const { urn, entity } = this;
const parts = getDatasetUrnParts(urn); const parts = getDatasetUrnParts(urn);

View File

@ -9,9 +9,7 @@ module('Integration | Component | dynamic-components/entity/field', function(hoo
test('it renders', async function(assert) { test('it renders', async function(assert) {
const fakeSeedInformation = { const fakeSeedInformation = {
dataset: {
description: `Pikachu's special dataset` description: `Pikachu's special dataset`
}
}; };
const testUnderlyingDataset = new DatasetEntity( const testUnderlyingDataset = new DatasetEntity(
'pikachu', 'pikachu',