Skip to content
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

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

Merged
merged 2 commits into from
Sep 15, 2020
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
7 changes: 6 additions & 1 deletion datahub-frontend/app/controllers/api/v2/Dataset.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public Result getDataset(@Nonnull String datasetUrn) {
return internalServerError(ControllerUtil.errorResponse(e));
}

return ok(Json.newObject().set("dataset", Json.toJson(view)));
return ok(Json.toJson(view));
}

@Security.Authenticated(Secured.class)
Expand Down Expand Up @@ -249,6 +249,11 @@ public Result getDatasetUpstreams(@Nonnull String datasetUrn) {
try {
upstreams = _lineageDao.getUpstreamLineage(datasetUrn);
} 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);
return internalServerError(ControllerUtil.errorResponse(e));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,33 +148,33 @@ export class DatasetEntity extends BaseEntity<Com.Linkedin.Dataset.Dataset> {
/**
* Whether or not the dataset has been deprecated
*/
@alias('entity.dataset.deprecated')
@alias('entity.deprecated')
igbopie marked this conversation as resolved.
Show resolved Hide resolved
deprecated?: boolean;

/**
* Note attached to the deprecation process for this dataset
*/
@alias('entity.dataset.deprecationNote')
@alias('entity.deprecationNote')
deprecationNote?: string;

/**
* Timestamp for when the dataset was deprecated
*/
@alias('entity.dataset.decommissionTime')
@alias('entity.decommissionTime')
decommissionTime?: number;

/**
* Last timestamp for the modification of this dataset
*/
@oneWay('entity.dataset.modifiedTime')
@oneWay('entity.modifiedTime')
modifiedTime?: number;

/**
* Whether or not the entity has been removed.
* Note: This overrides the BaseEntity implementation since DatasetEntity has a different behavior than
* other entities
*/
@oneWay('entity.dataset.removed')
@oneWay('entity.removed')
removed!: boolean;

/**
Expand All @@ -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
*/
@oneWay('entity.dataset.description')
@oneWay('entity.description')
description?: string;

/**
Expand All @@ -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
*/
@computed('entity.dataset.platform', 'urn')
@computed('entity.platform', 'urn')
get platform(): DatasetPlatform | undefined {
const { urn, entity } = this;
const parts = getDatasetUrnParts(urn);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ module('Integration | Component | dynamic-components/entity/field', function(hoo

test('it renders', async function(assert) {
const fakeSeedInformation = {
dataset: {
description: `Pikachu's special dataset`
}
description: `Pikachu's special dataset`
};
const testUnderlyingDataset = new DatasetEntity(
'pikachu',
Expand Down