Skip to content

Commit

Permalink
migrate from go/bqx to go/cloud/bqx (#871)
Browse files Browse the repository at this point in the history
* migrate from go/bqx to go/cloud/bqx

* reorder imports

* update bindata
  • Loading branch information
gfr10598 authored Apr 24, 2020
1 parent fa1bca4 commit 03127d7
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 28 deletions.
3 changes: 2 additions & 1 deletion bq/gke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import (
"cloud.google.com/go/bigquery"
"google.golang.org/api/googleapi"

"github.com/m-lab/go/cloud/bqx"

"github.com/m-lab/etl/bq"
"github.com/m-lab/etl/etl"
"github.com/m-lab/etl/fake"
"github.com/m-lab/etl/row"
"github.com/m-lab/go/bqx"
)

func init() {
Expand Down
3 changes: 2 additions & 1 deletion bq/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ import (
"cloud.google.com/go/bigquery"
"google.golang.org/api/googleapi"

"github.com/m-lab/go/cloud/bqx"

"github.com/m-lab/etl/etl"
"github.com/m-lab/etl/factory"
"github.com/m-lab/etl/metrics"
"github.com/m-lab/etl/row"
"github.com/m-lab/go/bqx"
)

// insertsBeforeRowJSONCount controls how often we perform a wasted JSON marshal
Expand Down
3 changes: 2 additions & 1 deletion cmd/generate_schema_docs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import (
"strings"

"cloud.google.com/go/bigquery"
"github.com/m-lab/go/bqx"

"github.com/m-lab/go/cloud/bqx"
"github.com/m-lab/go/flagx"
"github.com/m-lab/go/rtx"

Expand Down
10 changes: 5 additions & 5 deletions cmd/update-schema/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import (
"os"
"time"

"github.com/m-lab/go/flagx"
"cloud.google.com/go/bigquery"
"google.golang.org/api/googleapi"

"github.com/m-lab/etl/schema"
"github.com/m-lab/go/cloud/bqx"
"github.com/m-lab/go/flagx"
"github.com/m-lab/go/rtx"

"cloud.google.com/go/bigquery"
"github.com/m-lab/go/bqx"
"google.golang.org/api/googleapi"
"github.com/m-lab/etl/schema"
)

// CreateOrUpdateTCPInfo will update existing TCPInfo table, or create new table if update fails.
Expand Down
3 changes: 2 additions & 1 deletion parser/ndt5_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"cloud.google.com/go/bigquery"

v2as "github.com/m-lab/annotation-service/api/v2"

"github.com/m-lab/etl/annotation"
"github.com/m-lab/etl/etl"
"github.com/m-lab/etl/metrics"
Expand Down Expand Up @@ -65,7 +66,7 @@ func (dp *NDT5ResultParser) IsParsable(testName string, data []byte) (string, bo

// NOTE: data.NDT5Result is a JSON object that should be pushed directly into BigQuery.
// We read the value into a struct, for compatibility with current inserter
// backend and to eventually rely on the schema inference in m-lab/go/bqx.CreateTable().
// backend and to eventually rely on the schema inference in m-lab/go/cloud/bqx.CreateTable().

// ParseAndInsert decodes the data.NDT5Result JSON and inserts it into BQ.
func (dp *NDT5ResultParser) ParseAndInsert(meta map[string]bigquery.Value, testName string, test []byte) error {
Expand Down
6 changes: 4 additions & 2 deletions schema/annotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import (
"time"

"cloud.google.com/go/bigquery"
"github.com/m-lab/etl/row"
"github.com/m-lab/go/bqx"

"github.com/m-lab/go/cloud/bqx"
"github.com/m-lab/uuid-annotator/annotator"

"github.com/m-lab/etl/row"
)

// AnnotationRow defines the BQ schema using 'Standard Columns' conventions for
Expand Down
3 changes: 2 additions & 1 deletion schema/annotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import (
"testing"

"cloud.google.com/go/bigquery"
"github.com/m-lab/go/bqx"

"github.com/m-lab/go/cloud/bqx"
)

func TestAnnotationRow_Schema(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion schema/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion schema/descriptions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This directory contains BigQuery Field Description YAML files for schema
definitions in github.com/m-lab/etl/schema.

The content of these files should be formatted as bqx.SchemaDocs from the
github.com/m-lab/go/bqx package.
github.com/m-lab/go/cloud/bqx package.

Multiple files can be applied to the same schema.

Expand Down
6 changes: 4 additions & 2 deletions schema/ndt5_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package schema

import (
"cloud.google.com/go/bigquery"
"github.com/m-lab/etl/row"
"github.com/m-lab/go/bqx"

"github.com/m-lab/go/cloud/bqx"
"github.com/m-lab/ndt-server/data"

"github.com/m-lab/etl/row"
)

// NDT5ResultRow defines the BQ schema for the data.NDT5Result produced by the
Expand Down
3 changes: 2 additions & 1 deletion schema/ndt5_result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import (
"testing"

"cloud.google.com/go/bigquery"
"github.com/m-lab/go/bqx"

"github.com/m-lab/go/cloud/bqx"
)

func TestNDT5Result_Schema(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion schema/ndt7_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import (
"time"

"cloud.google.com/go/bigquery"

"github.com/m-lab/etl/row"
"github.com/m-lab/go/bqx"
"github.com/m-lab/go/cloud/bqx"

"github.com/m-lab/ndt-server/data"
)

Expand Down
3 changes: 2 additions & 1 deletion schema/ndt7_result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import (
"testing"

"cloud.google.com/go/bigquery"
"github.com/m-lab/go/bqx"

"github.com/m-lab/go/cloud/bqx"
)

func TestNDT7Result_Schema(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions schema/pt_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import (
"time"

"cloud.google.com/go/bigquery"

"github.com/m-lab/annotation-service/api"
"github.com/m-lab/go/cloud/bqx"

"github.com/m-lab/etl/metrics"
"github.com/m-lab/go/bqx"
)

type HopIP struct {
Expand Down Expand Up @@ -38,7 +40,7 @@ type ScamperHop struct {
type PTTest struct {
UUID string `json:"uuid,string" bigquery:"uuid"`
TestTime time.Time `json:"testtime"`
Parseinfo ParseInfoV0 `json:"parseinfo"`
Parseinfo ParseInfoV0 `json:"parseinfo"`
StartTime int64 `json:"start_time,int64" bigquery:"start_time"`
StopTime int64 `json:"stop_time,int64" bigquery:"stop_time"`
ScamperVersion string `json:"scamper_version,string" bigquery:"scamper_version"`
Expand Down
2 changes: 1 addition & 1 deletion schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"reflect"
"time"

"github.com/m-lab/go/bqx"
"github.com/m-lab/go/cloud/bqx"
"github.com/m-lab/go/rtx"
)

Expand Down
2 changes: 1 addition & 1 deletion schema/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/m-lab/go/bqx"
"github.com/m-lab/go/cloud/bqx"

"github.com/m-lab/etl/row"
"github.com/m-lab/etl/schema"
Expand Down
5 changes: 3 additions & 2 deletions schema/tcpinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import (
"cloud.google.com/go/bigquery"

"github.com/m-lab/annotation-service/api"
"github.com/m-lab/etl/metrics"
"github.com/m-lab/go/bqx"
"github.com/m-lab/go/cloud/bqx"
"github.com/m-lab/go/rtx"
"github.com/m-lab/tcp-info/inetdiag"
"github.com/m-lab/tcp-info/snapshot"

"github.com/m-lab/etl/metrics"
)

// ServerInfo details various information about the server.
Expand Down
7 changes: 4 additions & 3 deletions worker/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ import (
"time"

"cloud.google.com/go/storage"
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"

"github.com/m-lab/annotation-service/api"
v2 "github.com/m-lab/annotation-service/api/v2"
"github.com/m-lab/go/bqx"
"github.com/m-lab/go/cloud/bqx"
"github.com/m-lab/go/rtx"
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"

"github.com/m-lab/etl/bq"
"github.com/m-lab/etl/etl"
Expand Down

0 comments on commit 03127d7

Please sign in to comment.