Skip to content

Commit 4aa64fe

Browse files
authored
Add nil check in get call for gcp_bigquery_table table. closes #324 (#329)
1 parent 2a3e0bb commit 4aa64fe

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

gcp/table_gcp_bigquery_table.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ func getBigqueryTable(ctx context.Context, d *plugin.QueryData, h *plugin.Hydrat
304304
datasetID = d.KeyColumnQuals["dataset_id"].GetStringValue()
305305
id = d.KeyColumnQuals["table_id"].GetStringValue()
306306
}
307+
308+
// Empty Check
309+
if id == "" || datasetID == ""{
310+
return nil, nil
311+
}
307312

308313
resp, err := service.Tables.Get(project, datasetID, id).Do()
309314
if err != nil {
@@ -314,7 +319,7 @@ func getBigqueryTable(ctx context.Context, d *plugin.QueryData, h *plugin.Hydrat
314319

315320
//// TRANSFORM FUNCTIONS
316321

317-
func bigqueryTableAkas(ctx context.Context, h *transform.TransformData) (interface{}, error) {
322+
func bigqueryTableAkas(_ context.Context, h *transform.TransformData) (interface{}, error) {
318323
data := tableID(h.HydrateItem)
319324

320325
projectID := strings.Split(data, ":")[0]
@@ -326,7 +331,7 @@ func bigqueryTableAkas(ctx context.Context, h *transform.TransformData) (interfa
326331
return akas, nil
327332
}
328333

329-
func bigQueryTableTitle(ctx context.Context, h *transform.TransformData) (interface{}, error) {
334+
func bigQueryTableTitle(_ context.Context, h *transform.TransformData) (interface{}, error) {
330335
data := tableID(h.HydrateItem)
331336
name := tableName(h.HydrateItem)
332337

0 commit comments

Comments
 (0)