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

bug(cli): handle case insensitive entity types for cli delete #4492

Merged
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
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ project.ext.externalDependency = [
'opentelemetryApi': 'io.opentelemetry:opentelemetry-api:1.0.0',
'opentelemetryAnnotations': 'io.opentelemetry:opentelemetry-extension-annotations:1.0.0',
'opentracingJdbc':'io.opentracing.contrib:opentracing-jdbc:0.2.15',
'parseqTest': 'com.linkedin.parseq:parseq:3.0.7:test',
'parquet': 'org.apache.parquet:parquet-avro:1.12.0',
'picocli': 'info.picocli:picocli:4.5.0',
'playCache': 'com.typesafe.play:play-cache_2.11:2.6.18',
Expand Down
2 changes: 1 addition & 1 deletion docs/how/build-metadata-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public interface GraphBuilder<SNAPSHOT extends RecordTemplate> {
[entity]: ../what/entity.md
[aspect]: ../what/aspect.md
[GMS]: ../what/gms.md
[Local DAO]: ../../metadata-dao/src/main/java/com/linkedin/metadata/dao/BaseLocalDAO.java
[Local DAO]: ../../metadata-dao/src/main/java/com/linkedin/metadata/ebean/EbeanAspectDAO.java
[Remote DAO]: ../../metadata-dao/src/main/java/com/linkedin/metadata/dao/BaseRemoteDAO.java
[MAE]: ../what/mxe.md#metadata-audit-event-mae
[rest.li]: https://rest.li
Expand Down
12 changes: 6 additions & 6 deletions metadata-ingestion/src/datahub/cli/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,13 @@ def get_urns_by_filter(
filter_criteria = []
if env:
filter_criteria.append({"field": "origin", "value": env, "condition": "EQUAL"})

entity_type_lower = entity_type.lower()
if (
platform is not None
and entity_type == "dataset"
or entity_type == "dataflow"
or entity_type == "datajob"
or entity_type == "container"
and entity_type_lower == "dataset"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anywhere else we do these types of entity type comparisons in the CLI?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few others, but they look to be already using .lower() or are in tests

or entity_type_lower == "dataflow"
or entity_type_lower == "datajob"
or entity_type_lower == "container"
):
filter_criteria.append(
{
Expand All @@ -325,7 +325,7 @@ def get_urns_by_filter(
}
)
if platform is not None and (
entity_type.lower() == "chart" or entity_type.lower() == "dashboard"
entity_type_lower == "chart" or entity_type_lower == "dashboard"
):
filter_criteria.append(
{
Expand Down