Skip to content

Commit

Permalink
[Data Explorer] Fix missing field error from taking down the page (op…
Browse files Browse the repository at this point in the history
…ensearch-project#5626)

* Handle missing fields error

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* adds changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* ndo unnecessary changes to changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* cleanup changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* Fix PR number

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
  • Loading branch information
ashwin-pc committed Dec 19, 2023
1 parent 5695f9b commit 28c1fbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [BUG][Data] Support for custom filters with heterogeneous data fields ([5577](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5577))
- [BUG][Data] Fix empty suggestion history when querying in search bar [#5349](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5349)
- [BUG][Discover] Fix what is displayed in `selected fields` when removing columns from canvas [#5537](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5537)
- [Discover] Fix missing index pattern field from breaking Discover [#5626](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5626)

### 🚞 Infrastructure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,13 @@ export function createHistogramConfigs(
},
},
];
return data.search.aggs.createAggConfigs(indexPattern, visStateAggs);

// If index pattern is created before the index, this function will fail since the required fields for the histogram agg will be missing.
try {
return data.search.aggs.createAggConfigs(indexPattern, visStateAggs);
} catch (error) {
// Just display the error to the user but continue to render the rest of the page
data.search.showError(error as Error);
return;
}
}

0 comments on commit 28c1fbb

Please sign in to comment.