From ea71376003036990bd7985cc83563a63b8465b75 Mon Sep 17 00:00:00 2001 From: Cristina Leon Date: Thu, 4 Apr 2024 20:07:33 -0400 Subject: [PATCH] Require a partition filter for standard tables (#1132) * Require a partition filter for standard tables * Upgrade to latest version of m-lab/go * go mod tidy --- cmd/update-schema/update.go | 10 +++++----- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/update-schema/update.go b/cmd/update-schema/update.go index 82335dc36..f9aee0255 100644 --- a/cmd/update-schema/update.go +++ b/cmd/update-schema/update.go @@ -134,7 +134,11 @@ func CreateOrUpdate(client *bigquery.Client, schema bigquery.Schema, project, da log.Println("Successfully created dataset for", pdt) } - err = pdt.UpdateTable(ctx, client, schema) + partitioning := &bigquery.TimePartitioning{ + Field: partField, + } + + err = pdt.UpdateTable(ctx, client, schema, partitioning) if err == nil { log.Println("Successfully updated", pdt) return 0 @@ -147,10 +151,6 @@ func CreateOrUpdate(client *bigquery.Client, schema bigquery.Schema, project, da return 1 } - partitioning := &bigquery.TimePartitioning{ - Field: partField, - } - err = pdt.CreateTable(ctx, client, schema, "", partitioning, nil) if err == nil { log.Println("Successfully created", pdt) diff --git a/go.mod b/go.mod index a0fa08855..a1e91f6b2 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/iancoleman/strcase v0.2.0 github.com/kr/pretty v0.3.0 github.com/m-lab/etl-gardener v0.0.0-20220706163049-f6a4eced2192 - github.com/m-lab/go v0.1.66 + github.com/m-lab/go v0.1.72 github.com/m-lab/ndt-server v0.20.18 github.com/m-lab/tcp-info v1.5.3 github.com/m-lab/traceroute-caller v0.10.1 diff --git a/go.sum b/go.sum index 4b77af036..6d85d2e54 100644 --- a/go.sum +++ b/go.sum @@ -270,8 +270,8 @@ github.com/m-lab/annotation-service v0.0.0-20210713124633-fa227b3d5b2f h1:dLJUar github.com/m-lab/annotation-service v0.0.0-20210713124633-fa227b3d5b2f/go.mod h1:bW5A2AmUqyh6kGbmu4X8fYK2pRcfTvTjAXW/+4VQZUA= github.com/m-lab/etl-gardener v0.0.0-20220706163049-f6a4eced2192 h1:kplK/Eyw/IepsFGWW365hEzaI7rz/SoRAfiCo/SxX24= github.com/m-lab/etl-gardener v0.0.0-20220706163049-f6a4eced2192/go.mod h1:JMTxQHudYLHNUf700okKbrE9ZbPA4e9Ri2s4Z34tj4o= -github.com/m-lab/go v0.1.66 h1:adDJILqKBCkd5YeVhCrrjWkjoNRtDzlDr6uizWu5/pE= -github.com/m-lab/go v0.1.66/go.mod h1:O1D/EoVarJ8lZt9foANcqcKtwxHatBzUxXFFyC87aQQ= +github.com/m-lab/go v0.1.72 h1:M1A/qUQb1JXdYFHIboiu5YrHSlvBCgDbGjZuxnekDRQ= +github.com/m-lab/go v0.1.72/go.mod h1:BirARfHWjjXHaCGNyWCm/CKW1OarjuEj8Yn6Z2rc0M4= github.com/m-lab/ndt-server v0.20.18 h1:lcfeHHw/kyI4zDhJKBPc4r5I0hR5BKPqAY1LIhJ6xmo= github.com/m-lab/ndt-server v0.20.18/go.mod h1:NQyIilZvNVU3+EPYKmZWuZ2mHOPVwqD7c1gEPtkb+MA= github.com/m-lab/tcp-info v1.5.3 h1:4IspTPcNc8D8LNRvuFnID8gDiz+hxPAtYvpKZaiGGe8=