Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update module cloud.google.com/go/compute/metadata to v0.5.0 #1811

Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jul 1, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
cloud.google.com/go/compute/metadata v0.3.0 -> v0.5.0 age adoption passing confidence

Release Notes

googleapis/google-cloud-go (cloud.google.com/go/compute/metadata)

v0.5.0

Compare Source

  • bigquery:
    • The SQL types DATE, TIME and DATETIME are now supported. They correspond to
      the Date, Time and DateTime types in the new cloud.google.com/go/civil
      package.
    • Support for query parameters.
    • Support deleting a dataset.
    • Values from INTEGER columns will now be returned as int64, not int. This
      will avoid errors arising from large values on 32-bit systems.
  • datastore:
    • Nested Go structs encoded as Entity values, instead of a
      flattened list of the embedded struct's fields. This means that you may now have twice-nested slices, eg.
      type State struct {
        Cities  []struct{
          Populations []int
        }
      }
      See the announcement for
      more details.
    • Contexts no longer hold namespaces; instead you must set a key's namespace
      explicitly. Also, key functions have been changed and renamed.
    • The WithNamespace function has been removed. To specify a namespace in a Query, use the Query.Namespace method:
      q := datastore.NewQuery("Kind").Namespace("ns")
    • All the fields of Key are exported. That means you can construct any Key with a struct literal:
      k := &Key{Kind: "Kind",  ID: 37, Namespace: "ns"}
    • As a result of the above, the Key methods Kind, ID, d.Name, Parent, SetParent and Namespace have been removed.
    • NewIncompleteKey has been removed, replaced by IncompleteKey. Replace
      NewIncompleteKey(ctx, kind, parent)
      with
      IncompleteKey(kind, parent)
      and if you do use namespaces, make sure you set the namespace on the returned key.
    • NewKey has been removed, replaced by NameKey and IDKey. Replace
      NewKey(ctx, kind, name, 0, parent)
      NewKey(ctx, kind, "", id, parent)
      with
      NameKey(kind, name, parent)
      IDKey(kind, id, parent)
      and if you do use namespaces, make sure you set the namespace on the returned key.
    • The Done variable has been removed. Replace datastore.Done with iterator.Done, from the package google.golang.org/api/iterator.
    • The Client.Close method will have a return type of error. It will return the result of closing the underlying gRPC connection.
    • See the announcement for
      more details.

v0.4.0

Compare Source

  • bigquery:
    -NewGCSReference is now a function, not a method on Client.

    • Table.LoaderFrom now accepts a ReaderSource, enabling
      loading data into a table from a file or any io.Reader.
    • Client.Table and Client.OpenTable have been removed.
      Replace

      client.OpenTable("project", "dataset", "table")

      with

      client.DatasetInProject("project", "dataset").Table("table")
    • Client.CreateTable has been removed.
      Replace

      client.CreateTable(ctx, "project", "dataset", "table")

      with

      client.DatasetInProject("project", "dataset").Table("table").Create(ctx)
    • Dataset.ListTables have been replaced with Dataset.Tables.
      Replace

      tables, err := ds.ListTables(ctx)

      with

      it := ds.Tables(ctx)
      for {
          table, err := it.Next()
          if err == iterator.Done {
              break
          }
          if err != nil {
              // TODO: Handle error.
          }
          // TODO: use table.
      }
    • Client.Read has been replaced with Job.Read, Table.Read and Query.Read.
      Replace

      it, err := client.Read(ctx, job)

      with

      it, err := job.Read(ctx)

      and similarly for reading from tables or queries.

    • The iterator returned from the Read methods is now named RowIterator. Its
      behavior is closer to the other iterators in these libraries. It no longer
      supports the Schema method; see the next item.
      Replace

      for it.Next(ctx) {
          var vals ValueList
          if err := it.Get(&vals); err != nil {
              // TODO: Handle error.
          }
          // TODO: use vals.
      }
      if err := it.Err(); err != nil {
          // TODO: Handle error.
      }

      with
      for {
      var vals ValueList
      err := it.Next(&vals)
      if err == iterator.Done {
      break
      }
      if err != nil {
      // TODO: Handle error.
      }
      // TODO: use vals.
      }
      Instead of the RecordsPerRequest(n) option, write

      it.PageInfo().MaxSize = n

      Instead of the StartIndex(i) option, write

      it.StartIndex = i
    • ValueLoader.Load now takes a Schema in addition to a slice of Values.
      Replace

      func (vl *myValueLoader) Load(v []bigquery.Value)

      with

      func (vl *myValueLoader) Load(v []bigquery.Value, s bigquery.Schema)
    • Table.Patch is replace by Table.Update.
      Replace

      p := table.Patch()
      p.Description("new description")
      metadata, err := p.Apply(ctx)

      with

      metadata, err := table.Update(ctx, bigquery.TableMetadataToUpdate{
          Description: "new description",
      })
    • Client.Copy is replaced by separate methods for each of its four functions.
      All options have been replaced by struct fields.

      • To load data from Google Cloud Storage into a table, use Table.LoaderFrom.

        Replace

        client.Copy(ctx, table, gcsRef)

        with

        table.LoaderFrom(gcsRef).Run(ctx)

        Instead of passing options to Copy, set fields on the Loader:

        loader := table.LoaderFrom(gcsRef)
        loader.WriteDisposition = bigquery.WriteTruncate
      • To extract data from a table into Google Cloud Storage, use
        Table.ExtractorTo. Set fields on the returned Extractor instead of
        passing options.

        Replace

        client.Copy(ctx, gcsRef, table)

        with

        table.ExtractorTo(gcsRef).Run(ctx)
      • To copy data into a table from one or more other tables, use
        Table.CopierFrom. Set fields on the returned Copier instead of passing options.

        Replace

        client.Copy(ctx, dstTable, srcTable)

        with

        dst.Table.CopierFrom(srcTable).Run(ctx)
      • To start a query job, create a Query and call its Run method. Set fields
        on the query instead of passing options.

        Replace

        client.Copy(ctx, table, query)

        with

        query.Run(ctx)
    • Table.NewUploader has been renamed to Table.Uploader. Instead of options,
      configure an Uploader by setting its fields.
      Replace

      u := table.NewUploader(bigquery.UploadIgnoreUnknownValues())

      with

      u := table.NewUploader(bigquery.UploadIgnoreUnknownValues())
      u.IgnoreUnknownValues = true
  • pubsub: remove pubsub.Done. Use iterator.Done instead, where iterator is the package
    google.golang.org/api/iterator.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the renovate label Jul 1, 2024
@renovate renovate bot enabled auto-merge July 1, 2024 21:49
@renovate renovate bot force-pushed the renovate/cloud.google.com-go-compute-metadata-0.x branch 17 times, most recently from b0d0468 to 6079dc9 Compare July 8, 2024 15:52
@renovate renovate bot force-pushed the renovate/cloud.google.com-go-compute-metadata-0.x branch 2 times, most recently from 44077b0 to 18b58dd Compare July 10, 2024 19:17
@renovate renovate bot changed the title fix(deps): update module cloud.google.com/go/compute/metadata to v0.4.0 fix(deps): update module cloud.google.com/go/compute/metadata to v0.5.0 Jul 10, 2024
@renovate renovate bot force-pushed the renovate/cloud.google.com-go-compute-metadata-0.x branch 7 times, most recently from 75a1b1b to c80de20 Compare July 15, 2024 02:51
@renovate renovate bot force-pushed the renovate/cloud.google.com-go-compute-metadata-0.x branch from c80de20 to 552d9a3 Compare July 15, 2024 02:54
@haya14busa haya14busa merged commit 552d9a3 into master Jul 15, 2024
34 of 35 checks passed
@haya14busa haya14busa deleted the renovate/cloud.google.com-go-compute-metadata-0.x branch July 15, 2024 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant