Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
bbff282b
Unverified
Commit
bbff282b
authored
Oct 31, 2019
by
Ryan McKinley
Committed by
GitHub
Oct 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GEL: wrap arrow utils in async load (#20134)
parent
2d7d171e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
public/app/features/expressions/ExpressionDatasource.ts
+10
-3
public/app/features/expressions/util.ts
+1
-1
No files found.
public/app/features/expressions/ExpressionDatasource.ts
View file @
bbff282b
...
...
@@ -10,10 +10,9 @@ import { ExpressionQueryEditor } from './ExpressionQueryEditor';
import
{
Observable
,
from
}
from
'rxjs'
;
import
{
config
}
from
'@grafana/runtime'
;
import
{
getBackendSrv
}
from
'app/core/services/backend_srv'
;
import
{
gelResponseToDataFrames
}
from
'./util'
;
/**
* This is a singleton that is not actually instan
c
iated
* This is a singleton that is not actually instan
t
iated
*/
export
class
ExpressionDatasourceApi
extends
DataSourceApi
<
ExpressionQuery
>
{
constructor
(
instanceSettings
:
DataSourceInstanceSettings
)
{
...
...
@@ -53,11 +52,19 @@ export class ExpressionDatasourceApi extends DataSourceApi<ExpressionQuery> {
queries
:
queries
,
})
.
then
((
rsp
:
any
)
=>
{
return
{
data
:
gelResponseToDataFrames
(
rsp
)
}
as
DataQueryResponse
;
return
this
.
toDataQueryResponse
(
rsp
)
;
});
return
from
(
req
);
}
/**
* This makes the arrow libary loading async.
*/
async
toDataQueryResponse
(
rsp
:
any
):
Promise
<
DataQueryResponse
>
{
const
{
gelResponseToDataFrames
}
=
await
import
(
/* webpackChunkName: "apache-arrow-util" */
'./util'
);
return
{
data
:
gelResponseToDataFrames
(
rsp
)
};
}
testDatasource
()
{
return
Promise
.
resolve
({});
}
...
...
public/app/features/expressions/util.ts
View file @
bbff282b
import
{
DataFrame
,
FieldType
,
Field
,
Vector
}
from
'@grafana/data'
;
import
{
Table
,
ArrowType
}
from
'apache-arrow'
;
export
function
base64StringToArrowTable
(
text
:
string
)
{
export
function
base64StringToArrowTable
(
text
:
string
)
:
Table
{
const
b64
=
atob
(
text
);
const
arr
=
Uint8Array
.
from
(
b64
,
c
=>
{
return
c
.
charCodeAt
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment