Skip to content

Commit 58d63f7

Browse files
feat: Show bigquery datasource table and query on UI (feast-dev#3600)
Signed-off-by: Hai Nguyen <quanghai.ng1512@gmail.com>
1 parent 01a98f0 commit 58d63f7

File tree

3 files changed

+364
-6
lines changed

3 files changed

+364
-6
lines changed

ui/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"prop-types": "^15.8.1",
4444
"protobufjs": "^7.1.1",
4545
"query-string": "^7.1.1",
46+
"react-code-blocks": "^0.0.9-0",
4647
"react-query": "^3.34.12",
4748
"react-router-dom": "6",
4849
"react-scripts": "^5.0.0",

ui/src/pages/data-sources/BatchSourcePropertiesView.tsx

+19
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
EuiFlexGroup,
77
EuiFlexItem,
88
} from "@elastic/eui";
9+
import { CopyBlock, atomOneDark } from "react-code-blocks";
910
import { feast } from "../../protos";
1011
import { toDate } from "../../utils/timestamp";
1112

@@ -61,6 +62,24 @@ const BatchSourcePropertiesView = (props: BatchSourcePropertiesViewProps) => {
6162
</EuiDescriptionListDescription>
6263
</React.Fragment>
6364
)}
65+
{batchSource.bigqueryOptions && (
66+
<React.Fragment>
67+
<EuiDescriptionListTitle>Source {batchSource.bigqueryOptions.table ? "Table" : "Query"}</EuiDescriptionListTitle>
68+
{batchSource.bigqueryOptions.table ? (
69+
<EuiDescriptionListDescription>
70+
{batchSource.bigqueryOptions.table}
71+
</EuiDescriptionListDescription>
72+
) : <CopyBlock
73+
text={batchSource.bigqueryOptions.query}
74+
language="sql"
75+
showLineNumbers={false}
76+
theme={atomOneDark}
77+
wrapLines
78+
/>
79+
}
80+
81+
</React.Fragment>
82+
)}
6483
{batchSource.meta?.latestEventTimestamp && (
6584
<React.Fragment>
6685
<EuiDescriptionListTitle>Latest Event</EuiDescriptionListTitle>

0 commit comments

Comments
 (0)