Repository: apache/iceberg-go
Pull request #18 (2023-10-11 23:14:45)

build(deps): bump golang.org/x/net from 0.15.0 to 0.17.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.15.0 to 0.17.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/golang/net/commit/b225e7ca6dde1ef5a5ae5ce922861bda011cfabd"><code>b225e7c</code></a> http2: limit maximum handler goroutines to MaxConcurrentStreams</li>
<li><a href="https://github.com/golang/net/commit/88194ad8ab44a02ea952c169883c3f57db6cf9f4"><code>88194ad</code></a> go.mod: update golang.org/x dependencies</li>
<li><a href="https://github.com/golang/net/commit/2b60a61f1e4cf3a5ecded0bd7e77ea168289e6de"><code>2b60a61</code></a> quic: fix several bugs in flow control accounting</li>
<li><a href="https://github.com/golang/net/commit/73d82efb96cacc0c378bc150b56675fc191894b9"><code>73d82ef</code></a> quic: handle DATA_BLOCKED frames</li>
<li><a href="https://github.com/golang/net/commit/5d5a036a503f8accd748f7453c0162115187be13"><code>5d5a036</code></a> quic: handle streams moving from the data queue to the meta queue</li>
<li><a href="https://github.com/golang/net/commit/350aad2603e57013fafb1a9e2089a382fe67dc80"><code>350aad2</code></a> quic: correctly extend peer's flow control window after MAX_DATA</li>
<li><a href="https://github.com/golang/net/commit/21814e71db756f39b69fb1a3e06350fa555a79b1"><code>21814e7</code></a> quic: validate connection id transport parameters</li>
<li><a href="https://github.com/golang/net/commit/a600b3518eed7a9a4e24380b4b249cb986d9b64d"><code>a600b35</code></a> quic: avoid redundant MAX_DATA updates</li>
<li><a href="https://github.com/golang/net/commit/ea633599b58dc6a50d33c7f5438edfaa8bc313df"><code>ea63359</code></a> http2: check stream body is present on read timeout</li>
<li><a href="https://github.com/golang/net/commit/ddd8598e5694aa5e966e44573a53e895f6fa5eb2"><code>ddd8598</code></a> quic: version negotiation</li>
<li>Additional commits viewable in <a href="https://github.com/golang/net/compare/v0.15.0...v0.17.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/net&package-manager=go_modules&previous-version=0.15.0&new-version=0.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/apache/iceberg-go/network/alerts).

</details>


Patch:
diff --git a/.asf.yaml b/.asf.yaml
index ffd625d..e735371 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -28,7 +28,19 @@ github:
   features:
     issues: true
 
+  enabled_merge_buttons:
+    squash: true
+    merge: false
+    rebase: false
+
+  protected_branches:
+    main:
+      required_pull_request_reviews:
+        required_approving_review_count: 1
+
+      required_linear_history: true
+
 notifications:
   commits:      commits@iceberg.apache.org
   issues:       issues@iceberg.apache.org
-  pullrequests: issues@iceberg.apache.org
\ No newline at end of file
+  pullrequests: issues@iceberg.apache.org
diff --git a/go.mod b/go.mod
index 827297b..4894113 100644
--- a/go.mod
+++ b/go.mod
@@ -54,6 +54,6 @@ require (
 	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/stretchr/objx v0.5.0 // indirect
-	golang.org/x/net v0.15.0 // indirect
+	golang.org/x/net v0.17.0 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )
diff --git a/go.sum b/go.sum
index 6e1fc0f..2bee392 100644
--- a/go.sum
+++ b/go.sum
@@ -72,8 +72,8 @@ github.com/wolfeidau/s3iofs v1.3.0 h1:O6lf4HCZVuHMjCdMYrpQIfKzLDYbO5BtNrH5RdQGv4
 github.com/wolfeidau/s3iofs v1.3.0/go.mod h1:oWH749wXNok7pJ+5MK7mi5uyS7GqQzeGApEGwUSaIjc=
 golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
 golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
-golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
-golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
+golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
+golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/internal/avro_schemas.go b/internal/avro_schemas.go
index 4628787..893b7b2 100644
--- a/internal/avro_schemas.go
+++ b/internal/avro_schemas.go
@@ -40,7 +40,7 @@ func init() {
 			{"name": "partition_spec_id", "type": "int", "doc": "Spec ID used to write", "field-id": 502},
 			{
 				"name": "added_snapshot_id",
-				"type": ["null", "long"],
+				"type": "long",
 				"doc": "Snapshot ID that added the manifest",
 				"field-id": 503
 			},
diff --git a/manifest.go b/manifest.go
index 628b721..1d1113e 100644
--- a/manifest.go
+++ b/manifest.go
@@ -52,21 +52,17 @@ type ManifestV1Builder struct {
 // NewManifestV1Builder is passed all of the required fields and then allows
 // all of the optional fields to be set by calling the corresponding methods
 // before calling [ManifestV1Builder.Build] to construct the object.
-func NewManifestV1Builder(path string, length int64, partitionSpecID int32) *ManifestV1Builder {
+func NewManifestV1Builder(path string, length int64, partitionSpecID int32, addedSnapshotID int64) *ManifestV1Builder {
 	return &ManifestV1Builder{
 		m: &manifestFileV1{
-			Path:   path,
-			Len:    length,
-			SpecID: partitionSpecID,
+			Path:            path,
+			Len:             length,
+			SpecID:          partitionSpecID,
+			AddedSnapshotID: addedSnapshotID,
 		},
 	}
 }
 
-func (b *ManifestV1Builder) AddedSnapshotID(id int64) *ManifestV1Builder {
-	b.m.AddedSnapshotID = &id
-	return b
-}
-
 func (b *ManifestV1Builder) AddedFiles(cnt int32) *ManifestV1Builder {
 	b.m.AddedFilesCount = &cnt
 	return b
@@ -119,7 +115,7 @@ type manifestFileV1 struct {
 	Path               string          `avro:"manifest_path"`
 	Len                int64           `avro:"manifest_length"`
 	SpecID             int32           `avro:"partition_spec_id"`
-	AddedSnapshotID    *int64          `avro:"added_snapshot_id"`
+	AddedSnapshotID    int64           `avro:"added_snapshot_id"`
 	AddedFilesCount    *int32          `avro:"added_data_files_count"`
 	ExistingFilesCount *int32          `avro:"existing_data_files_count"`
 	DeletedFilesCount  *int32          `avro:"deleted_data_files_count"`
@@ -138,10 +134,7 @@ func (m *manifestFileV1) ManifestContent() ManifestContent {
 	return ManifestContentData
 }
 func (m *manifestFileV1) SnapshotID() int64 {
-	if m.AddedSnapshotID == nil {
-		return 0
-	}
-	return *m.AddedSnapshotID
+	return m.AddedSnapshotID
 }
 
 func (m *manifestFileV1) AddedDataFiles() int32 {


Test patch:
diff --git a/manifest_test.go b/manifest_test.go
index 74d063e..486c6a8 100644
--- a/manifest_test.go
+++ b/manifest_test.go
@@ -33,8 +33,7 @@ var (
 	addedRows             int64 = 237993
 	manifestFileRecordsV1       = []ManifestFile{
 		NewManifestV1Builder("/home/iceberg/warehouse/nyc/taxis_partitioned/metadata/0125c686-8aa6-4502-bdcc-b6d17ca41a3b-m0.avro",
-			7989, 0).
-			AddedSnapshotID(snapshotID).
+			7989, 0, snapshotID).
 			AddedFiles(3).
 			ExistingFiles(0).
 			DeletedFiles(0).