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

Adding ability to import dataset asset with no 'targets' field like filter divider #321

Merged
merged 8 commits into from
Oct 25, 2024
3 changes: 1 addition & 2 deletions src/preset_cli/cli/superset/sync/native/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def native( # pylint: disable=too-many-locals, too-many-arguments, too-many-bra
url = URL(ctx.obj["INSTANCE"])
client = SupersetClient(url, auth)
root = Path(directory)

base_url = URL(external_url_prefix) if external_url_prefix else None

# collecting existing database UUIDs so we know if we're creating or updating
Expand Down Expand Up @@ -326,7 +325,7 @@ def get_dataset_filter_uuids(config: AssetConfig) -> Set[str]:
"""
dataset_uuids = set()
for filter_config in config["metadata"].get("native_filter_configuration", []):
for target in filter_config["targets"]:
for target in filter_config.get("targets", dict()):
Vitor-Avila marked this conversation as resolved.
Show resolved Hide resolved
if uuid := target.get("datasetUuid"):
if uuid not in dataset_uuids:
dataset_uuids.add(uuid)
Expand Down
Loading