FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat!: migrate to v2.0.0 by larkee · Pull Request #147 · googleapis/python-spanner · GitHub

This repository was archived by the owner on Jun 8, 2026. It is now read-only.
/ python-spanner Public archive

feat!: migrate to v2.0.0 - #147

Merged
larkee merged 99 commits into
googleapis:masterfrom
larkee:generator-migration
Nov 11, 2020
Merged

larkee merged 99 commits into
googleapis:masterfrom
larkee:generator-migration

Conversation

larkee commented Oct 2, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

This PR is a preview of the 2.0 release.

TODO list:

  • Fix docs.

  • Describe changes in UPGRADING guide.

BREAKING CHANGES

  • list_instances, list_databases, list_instance_configs, and list_backups will now return protos rather than the handwritten wrapper

google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 2, 2020
larkee requested a review from busunkim96 October 6, 2020 02:31

Copy link
Copy Markdown
Contributor

Thank you for working on this!

larkee commented Oct 7, 2020

Copy link
Copy Markdown
Contributor Author
  • I noticed there doesn't seem to be a samples presubmit. I opened 335755839 to add those kokoro configs internally.

Thanks! I wasn't sure what was missing.

Handwritten files have been moved from google/cloud/spanner_v1 to google/cloud/spanner

I believe the other handwritten/generated mixes keep the generated surface in the versioned directory. What is the
motivation for the change?
https://github.com/googleapis/python-firestore/tree/master/google/cloud/firestore_v1
https://github.com/googleapis/python-pubsub/tree/v2.1.0/google/cloud/pubsub_v1

The motivation was two fold. It separates the handwritten surfaces which makes it clearer to contributes what is written and what is generated. It also prevents having to customize the generated google/cloud/spanner_v1/__init__.py. However given that this file shouldn't change too much, it's probably reasonable to exclude it from generation and manually update it when required.

I'm happy to revert these files back to their original folder if you think that would be best.

  • I'm not familiar with the Spanner client, are there particular files we should direct our attention to?

Most of the handwritten surfaces are used directly by users. The major ones are:

  • client.py
  • instance.py
  • database.py
  • backup.py
  • `batch.py
  • snapshot.py
  • transaction.py

However, the files that changed the most during migration are:

  • _helpers.py
  • snapshot.py
  • streamed.py
  • transaction.py

busunkim96 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I would prefer the handwritten code live in the versioned directory for consistency with the other libraries. It looks like firestore excludes __init__.py in synth.py https://github.com/googleapis/python-firestore/blob/c3acd4a04745c93edb2f61bf9be6fa33f439f4b0/synth.py#L41

Fully generated libraries use the unversioned path google/cloud/{api}/ for the default alias (equivalent of google/cloud/spanner.py) https://github.com/googleapis/python-speech/blob/master/google/cloud/speech/__init__.py so there's also a small chance for confusion there.

larkee requested a review from busunkim96 October 26, 2020 04:53
Comment thread google/cloud/spanner.py Outdated
Comment thread google/cloud/spanner.py
Comment thread google/cloud/spanner_v1/streamed.py Outdated
larkee force-pushed the generator-migration branch from d1c3dab to bf06add Compare November 3, 2020 06:30
larkee marked this pull request as ready for review November 5, 2020 07:16
larkee requested a review from a team November 5, 2020 07:16
larkee requested a review from a team as a code owner November 5, 2020 07:16

skuruppu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I only reviewed UPGRADING.md so my LGTM is for that file.

Comment thread UPGRADING.md Outdated
c24t mentioned this pull request Nov 10, 2020
larkee merged commit bf4b278 into googleapis:master Nov 11, 2020
release-please Bot mentioned this pull request Nov 11, 2020

wyardley commented Dec 1, 2020

Copy link
Copy Markdown

@larkee: In the end, the "breaking change" that shows up in the changelog was
migrate to v2.0.0 (#147) vs

list_instances, list_databases, list_instance_configs, and list_backups will now return protos rather than the handwritten wrapper

which would have been much more useful

larkee commented Dec 2, 2020

Copy link
Copy Markdown
Contributor Author

@wyardley My apologies! I'll do my best to label changes better in future 👍 I'll update the changelog directly to show the more useful message

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL