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 hack for legacy Metrics Views #5866

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

ericpgreen2
Copy link
Contributor

@ericpgreen2 ericpgreen2 commented Oct 9, 2024

Context

A file specifying a legacy Metrics View generates 2 resources: a Metrics View and an Explore. However, the FileArtifact class (which impacts much client-side code) makes the assumption that a file is associated with 0 or 1 resource.

In the FileArtifact class, for legacy Metrics View files, we've added a hack so that we ignore the generated Explore resource.

Problem

The original hack wrongly ignored the Explore resource for Explore files placed in the /dashboards directory. (Because we previously assumed that any file placed in the /dashboards directory was a legacy Metrics View.)

Solution

The new hack identifies when an Explore resource is associated with a legacy Metrics View by checking to see if the file is already associated with a Metrics View. This should work because, for legacy Metrics Views, the parser first creates the Metrics View and second creates the Explore.

(In the long-run, it'd be nice if we could remove the assumption that a file generates at most 1 resource.)

@ericpgreen2 ericpgreen2 merged commit 1b13c35 into main Oct 10, 2024
9 checks passed
@ericpgreen2 ericpgreen2 deleted the fix-hack-for-legacy-metrics-views branch October 10, 2024 01:39
ericpgreen2 added a commit that referenced this pull request Oct 10, 2024
k-anshul pushed a commit that referenced this pull request Oct 15, 2024
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.

2 participants