This repository has been archived by the owner on Dec 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(query): Add force to QueryContext (#445)
* Add force to QueryContext * fix tests * fix test
- Loading branch information
Showing
5 changed files
with
21 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
import { buildQueryContext } from '../src'; | ||
|
||
describe('buildQueryContext', () => { | ||
it('should build datasource for table sources', () => { | ||
it('should build datasource for table sources and default force to false', () => { | ||
const queryContext = buildQueryContext({ | ||
datasource: '5__table', | ||
granularity_sqla: 'ds', | ||
viz_type: 'table', | ||
}); | ||
expect(queryContext.datasource.id).toBe(5); | ||
expect(queryContext.datasource.type).toBe('table'); | ||
expect(queryContext.force).toBe(false); | ||
}); | ||
|
||
it('should build datasource for druid sources', () => { | ||
it('should build datasource for druid sources and set force to true', () => { | ||
const queryContext = buildQueryContext({ | ||
datasource: '5__druid', | ||
granularity: 'ds', | ||
viz_type: 'table', | ||
force: true, | ||
}); | ||
expect(queryContext.datasource.id).toBe(5); | ||
expect(queryContext.datasource.type).toBe('druid'); | ||
expect(queryContext.force).toBe(true); | ||
}); | ||
}); |
a243911
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: