Skip to content

Commit

Permalink
fix(browsepathv2): default browse path with empty space (#8503)
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal authored Jul 25, 2023
1 parent 77ace58 commit db42998
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import static com.linkedin.metadata.Constants.CONTAINER_ASPECT_NAME;

Expand Down Expand Up @@ -140,7 +141,9 @@ private static BrowsePathEntryArray getContainerPathEntries(@Nonnull final Urn e
private static BrowsePathEntryArray getDefaultDatasetPathEntries(@Nonnull final String datasetName, @Nonnull final Character delimiter) {
BrowsePathEntryArray browsePathEntries = new BrowsePathEntryArray();
if (datasetName.contains(delimiter.toString())) {
final List<String> datasetNamePathParts = Arrays.asList(datasetName.split(Pattern.quote(delimiter.toString())));
final List<String> datasetNamePathParts = Arrays.stream(datasetName.split(Pattern.quote(delimiter.toString())))
.filter((name) -> !name.isEmpty())
.collect(Collectors.toList());
// Omit the name from the path.
datasetNamePathParts.subList(0, datasetNamePathParts.size() - 1).forEach((part -> {
browsePathEntries.add(createBrowsePathEntry(part, null));
Expand Down

0 comments on commit db42998

Please sign in to comment.