Skip to content

Commit

Permalink
fix: remove duplicate name warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
saraburns1 committed Sep 26, 2024
1 parent 6105f5c commit 1e0ea00
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
24 changes: 0 additions & 24 deletions tutoraspects/asset_command_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,30 +475,6 @@ def deduplicate_superset_assets(echo):
echo("Deduplication complete.")


def check_asset_names(echo):
"""
Warn about any duplicate asset names.
"""
echo("Looking for duplicate names...")
warn = 0

names = set()
for _, asset in _get_asset_files():
for k in ("slice_name", "dashboard_title", "database_name"):
if k in asset:
if asset[k] in names:
warn += 1
echo(
f"WARNING: Duplicate {k} {asset[k]} in {asset.get('_file_name')}"
)
names.add(asset[k])
break

echo(
f"{warn} duplicate names detected. This could confuse users, consider changing them."
)


def _get_all_chart_dataset_uuids():
"""
Return the UUIDs of all datasets and charts in our file assets.
Expand Down
6 changes: 0 additions & 6 deletions tutoraspects/commands_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from tutoraspects.asset_command_helpers import (
ASSETS_PATH,
SupersetCommandError,
check_asset_names,
deduplicate_superset_assets,
import_superset_assets,
delete_aspects_unused_assets,
Expand Down Expand Up @@ -360,8 +359,6 @@ def serialize_zip(file, base_assets_path):
click.echo()
deduplicate_superset_assets(click.echo)

click.echo()
check_asset_names(click.echo)
click.echo()
delete_aspects_unused_assets()

Expand All @@ -383,9 +380,6 @@ def check_superset_assets():
"""
deduplicate_superset_assets(click.echo)

click.echo()
check_asset_names(click.echo)

click.echo()
delete_aspects_unused_assets()

Expand Down

0 comments on commit 1e0ea00

Please sign in to comment.