Skip to content

Commit f611371

Browse files
Remove hopannotation1 schema stub (#1024)
1 parent 05315ee commit f611371

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,9 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
296296
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
297297
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
298298
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
299+
github.com/oschwald/geoip2-golang v1.5.0 h1:igg2yQIrrcRccB1ytFXqBfOHCjXWIoMv85lVJ1ONZzw=
299300
github.com/oschwald/geoip2-golang v1.5.0/go.mod h1:xdvYt5xQzB8ORWFqPnqMwZpCpgNagttWdoZLlJQzg7s=
301+
github.com/oschwald/maxminddb-golang v1.8.0 h1:Uh/DSnGoxsyp/KYbY1AuP0tYEwfs0sCph9p/UMXK/Hk=
300302
github.com/oschwald/maxminddb-golang v1.8.0/go.mod h1:RXZtst0N6+FY/3qCNmZMBApR19cdQj43/NM9VkrNAis=
301303
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
302304
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

parser/hopannotation1.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/m-lab/etl/metrics"
1313
"github.com/m-lab/etl/row"
1414
"github.com/m-lab/etl/schema"
15+
"github.com/m-lab/traceroute-caller/hopannotation"
1516
)
1617

1718
//=====================================================================================
@@ -62,7 +63,7 @@ func (p *HopAnnotation1Parser) ParseAndInsert(fileMetadata map[string]bigquery.V
6263
},
6364
}
6465

65-
raw := schema.HopAnnotation1{}
66+
raw := hopannotation.HopAnnotation1{}
6667
err := json.Unmarshal(rawContent, &raw)
6768
if err != nil {
6869
metrics.TestCount.WithLabelValues(p.TableName(), "hopannotation1", "decode-location-error").Inc()

parser/hopannotation1_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/m-lab/etl/parser"
1414
"github.com/m-lab/etl/schema"
1515
"github.com/m-lab/go/rtx"
16+
"github.com/m-lab/traceroute-caller/hopannotation"
1617
"github.com/m-lab/uuid-annotator/annotator"
1718
)
1819

@@ -82,7 +83,7 @@ func TestHopAnnotation1Parser_ParseAndInsert(t *testing.T) {
8283
Network: &expectedNetwork,
8384
}
8485

85-
expectedRaw := schema.HopAnnotation1{
86+
expectedRaw := hopannotation.HopAnnotation1{
8687
ID: "20210818_1e0b318cf3c2_91.189.88.152",
8788
Timestamp: time.Date(2021, 8, 18, 17, 44, 32, 0, time.UTC),
8889
Annotations: &expectedAnnotations,

schema/hopannotation1.go

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
11
package schema
22

33
import (
4-
"time"
5-
64
"cloud.google.com/go/bigquery"
75
"cloud.google.com/go/civil"
86
"github.com/m-lab/etl/row"
97
"github.com/m-lab/go/cloud/bqx"
10-
"github.com/m-lab/uuid-annotator/annotator"
8+
"github.com/m-lab/traceroute-caller/hopannotation"
119
)
1210

13-
// Schema stub for HopAnnotation1.
14-
// TODO(cristinaleon): Remove this definition when traceroute-caller is available.
15-
type HopAnnotation1 struct {
16-
ID string
17-
Timestamp time.Time
18-
Annotations *annotator.ClientAnnotations
19-
}
20-
2111
// HopAnnotation1Row describes a single BQ row of HopAnnotation1 data.
2212
type HopAnnotation1Row struct {
23-
ID string `bigquery:"id"`
24-
Parser ParseInfo `bigquery:"parser"`
25-
Date civil.Date `bigquery:"date"`
26-
Raw *HopAnnotation1 `json:",omitempty" bigquery:"raw"`
13+
ID string `bigquery:"id"`
14+
Parser ParseInfo `bigquery:"parser"`
15+
Date civil.Date `bigquery:"date"`
16+
Raw *hopannotation.HopAnnotation1 `json:",omitempty" bigquery:"raw"`
2717

2818
// NOT part of struct schema. Included only to provide a fake annotator interface.
2919
row.NullAnnotator `bigquery:"-"`

0 commit comments

Comments
 (0)