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

fix(import-assets): Include all dashboard depedencies when using the the --split flag #292

Merged
merged 1 commit into from
May 9, 2024

Conversation

Vitor-Avila
Copy link
Contributor

The sync native / import-assets command allows users to include a --split flag to import resources individually. It's possible to create dashboard filters using datasets that aren't used by any chart. The logic was currently not including these datasets when importing the dashboard, resulting in an import error.

Comment on lines +328 to +330
for filter_config in config["metadata"].get("native_filter_configuration", []):
for target in filter_config["targets"]:
if uuid := target.get("datasetUuid"):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From my tests:

  • Even if the dashboard doesn't have any elements, it always have the position and metadata keys/configurations.
  • If the dashboard never had a filter created, it might not include the native_filter_configuration key.
  • Even filters that don't have a target (such as temporal) still include a blank targets key.
  • If the filter dataset was deleted, its target config won't have a datasetUuid field.

@Vitor-Avila Vitor-Avila merged commit 7a0e761 into main May 9, 2024
5 checks passed
@Vitor-Avila Vitor-Avila deleted the import-all-dependencies branch May 9, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants