Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Fixes #221 #223

Merged
merged 1 commit into from
Mar 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dist/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -59880,14 +59880,14 @@ function () {
_this.getDateFields(project, dataset, table_1).then(function (dateFields) {
var tm = BigQueryDatasource._FindTimeField(tmpQ, dateFields);

_this.queryModel.target.rawSql = query.rawSql;
_this.queryModel.target.timeColumn = tm.text;
_this.queryModel.target.timeColumnType = tm.value;
_this.queryModel.target.table = table_1;
})["catch"](function (err) {
console.log(err);
});

_this.queryModel.target.rawSql = query.rawSql;
modOptions = BigQueryDatasource._setupTimeShiftQuery(query, options);

var q = _this.setUpQ(modOptions, options, query);
Expand Down Expand Up @@ -60228,6 +60228,7 @@ function () {
};

BigQueryDatasource.prototype.setUpQ = function (modOptions, options, query) {
console.log("setUpQ this.queryModel.target.rawSql", this.queryModel.target.rawSql);
var q = this.queryModel.expend_macros(modOptions);
q = BigQueryDatasource._updatePartition(q, modOptions);
q = BigQueryDatasource._updateTableSuffix(q, modOptions);
Expand Down
2 changes: 1 addition & 1 deletion dist/module.js.map

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,18 +312,15 @@ export class BigQueryDatasource {
this.getDateFields(project, dataset, table)
.then(dateFields => {
const tm = BigQueryDatasource._FindTimeField(tmpQ, dateFields);
this.queryModel.target.rawSql = query.rawSql;
this.queryModel.target.timeColumn = tm.text;
this.queryModel.target.timeColumnType = tm.value;
this.queryModel.target.table = table;
})
.catch(err => {
console.log(err);
});
modOptions = BigQueryDatasource._setupTimeShiftQuery(
query,
options
);
this.queryModel.target.rawSql = query.rawSql;
modOptions = BigQueryDatasource._setupTimeShiftQuery(query, options);
const q = this.setUpQ(modOptions, options, query);
console.log(q);
return this.doQuery(q, options.panelId + query.refId).then(
Expand Down Expand Up @@ -523,6 +520,7 @@ export class BigQueryDatasource {
);
}
private setUpQ(modOptions, options, query) {
console.log("setUpQ this.queryModel.target.rawSql", this.queryModel.target.rawSql)
let q = this.queryModel.expend_macros(modOptions);
q = BigQueryDatasource._updatePartition(q, modOptions);
q = BigQueryDatasource._updateTableSuffix(q, modOptions);
Expand Down