Skip to content

Commit

Permalink
Pass if the query doesn't have Builder or Settings (#138)
Browse files Browse the repository at this point in the history
Co-authored-by: Ghazanfar-CFLT <[email protected]>
  • Loading branch information
m-ghazanfar and m-ghazanfar authored Jan 24, 2023
1 parent 5e95a26 commit 6818ead
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/druid.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,13 @@ func (ds *druidDatasource) prepareQuery(qry []byte, s *druidInstanceSettings) (d
if err != nil {
return nil, nil, err
}
if q.Builder == nil || q.Settings == nil {
// Don't return an error here, as this isn't a user error
// Grafana seems to invoke this even before the user has entered any query
log.DefaultLogger.Debug("Invalid query issued to Druid Plugin: missing builder or settings", "query:", string(qry))
return nil, nil, nil
}

var defaultQueryContext map[string]interface{}
if defaultContextParameters, ok := s.defaultQuerySettings["contextParameters"]; ok {
defaultQueryContext = ds.prepareQueryContext(defaultContextParameters.([]interface{}))
Expand Down

0 comments on commit 6818ead

Please sign in to comment.