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

[ui] Filter hidden definitions tags #23771

Closed
wants to merge 4 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import {DagsterTypeSummary} from '../dagstertype/DagsterType';
import {
AssetComputeKindTag,
AssetStorageKindTag,
HIDDEN_TAG_PREFIX,
isCanonicalStorageKindTag,
} from '../graph/KindTags';
import {CodeReferencesMetadataEntry, IntMetadataEntry} from '../graphql/types';
Expand Down Expand Up @@ -266,7 +267,9 @@ export const AssetNodeOverview = ({
);

const storageKindTag = assetNode.tags?.find(isCanonicalStorageKindTag);
const filteredTags = assetNode.tags?.filter((tag) => tag.key !== 'dagster/storage_kind');
const filteredTags = assetNode.tags?.filter(
(tag) => tag.key !== 'dagster/storage_kind' && !tag.key.startsWith(HIDDEN_TAG_PREFIX),
);
const relationIdentifierMetadata = assetNode.metadataEntries?.find(
isCanonicalRelationIdentifierEntry,
);
Expand Down
2 changes: 2 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/graph/KindTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export const LEGACY_COMPUTE_KIND_TAG = 'kind';
export const COMPUTE_KIND_TAG = 'dagster/compute_kind';
export const STORAGE_KIND_TAG = 'dagster/storage_kind';

export const HIDDEN_TAG_PREFIX = '.dagster/';

// Older code servers may be using the legacy compute kind tag, so we need to check for both
export const isCanonicalComputeKindTag = (tag: DefinitionTag) =>
tag.key === COMPUTE_KIND_TAG || tag.key === LEGACY_COMPUTE_KIND_TAG;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import isEqual from 'lodash/isEqual';
import memoize from 'lodash/memoize';
import {useMemo} from 'react';

import {HIDDEN_TAG_PREFIX} from '../../graph/KindTags';
import {DefinitionTag} from '../../graphql/types';
import {TruncatedTextWithFullTextOnHover} from '../../nav/getLeftNavItemsForOption';
import {StaticBaseConfig, useStaticSetFilter} from '../BaseFilters/useStaticSetFilter';
Expand Down Expand Up @@ -53,7 +54,12 @@ export function useAssetTagsForAssets(
Array.from(
new Set(
assets
.flatMap((a) => a.definition?.tags?.map((tag) => JSON.stringify(tag)) ?? [])
.flatMap(
(a) =>
a.definition?.tags
?.filter((tag) => !tag.key.startsWith(HIDDEN_TAG_PREFIX))
.map((tag) => JSON.stringify(tag)) ?? [],
)
.filter((o) => o),
),
)
Expand Down