Skip to content

Commit

Permalink
fix: remove query dedupe for now, it's broken
Browse files Browse the repository at this point in the history
  • Loading branch information
b5 committed Dec 15, 2017
1 parent 4e80265 commit a27c274
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions core/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,22 @@ func (r *QueryRequests) Run(p *RunParams, res *repo.DatasetRef) error {
return fmt.Errorf("error calculating query hash: %s", err.Error())
}

if qi, err := r.repo.QueryLogItem(&repo.QueryLogItem{Key: qrpath}); err != nil && err != repo.ErrNotFound {
return fmt.Errorf("error checking for existing query: %s", err.Error())
} else if err != repo.ErrNotFound {
if ds, err := dsfs.LoadDataset(store, qi.DatasetPath); err == nil {
// ref := &repo.QueryLogItem{Name: p.SaveName, Query: q.Data, Key: dsp, Dataset: dsp}
// if err := r.repo.LogQuery(ref); err != nil {
// return fmt.Errorf("error logging query to repo: %s", err.Error())
// }
*res = repo.DatasetRef{
Path: qi.DatasetPath,
Dataset: ds,
}
return nil
}
}
// TODO - currently broken. Fix & Add Tests
// if qi, err := r.repo.QueryLogItem(&repo.QueryLogItem{Key: qrpath}); err != nil && err != repo.ErrNotFound {
// return fmt.Errorf("error checking for existing query: %s", err.Error())
// } else if err != repo.ErrNotFound {
// if ds, err := dsfs.LoadDataset(store, qi.DatasetPath); err == nil {
// // ref := &repo.QueryLogItem{Name: p.SaveName, Query: q.Data, Key: dsp, Dataset: dsp}
// // if err := r.repo.LogQuery(ref); err != nil {
// // return fmt.Errorf("error logging query to repo: %s", err.Error())
// // }
// *res = repo.DatasetRef{
// Path: qi.DatasetPath,
// Dataset: ds,
// }
// return nil
// }
// }

if q.Structure != nil {
fmt.Println("q structure post-queryLogItem:", q.Structure.Schema.FieldNames())
Expand Down

0 comments on commit a27c274

Please sign in to comment.