Skip to content

Conversation

@lukesneeringer
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 4, 2018
@theacodes
Copy link
Contributor

Towards #4692

@theacodes theacodes added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jan 4, 2018
@theacodes theacodes changed the title Spanner: Re-generate autogen. Spanner: Re-generate gapic and drop usage of gax Jan 4, 2018
@theacodes
Copy link
Contributor

@lukesneeringer for co-located generated code, we need to make this line:

_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution(
    'google-cloud-spanner-admin-database', ).version

into a template so we can make it say:

_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution(
    'google-cloud-spanner', ).version

Will manually fix for the time being. Do you wanna file a toolkit bug for it?

@theacodes
Copy link
Contributor

theacodes commented Jan 4, 2018

Also note that the generator clobbered spanner_v1/__init__.py, see 2954120.

@theacodes
Copy link
Contributor

Additionally, the autogenerated tests failed to account for the true location of SpannerClient because it's not surfaced in google.cloud.spanner_v1. See 129b26d

@lukesneeringer
Copy link
Contributor Author

Will manually fix for the time being. Do you wanna file a toolkit bug for it?

I think that might be configurable already. I will check.

super(HTTPIterator, self).__init__(
client, item_to_value, page_token=page_token,
max_results=max_results)
self.client = client

This comment was marked as spam.

This comment was marked as spam.

# limitations under the License.

"""Google namespace package."""

This comment was marked as spam.

This comment was marked as spam.

# limitations under the License.

"""Google Cloud namespace package."""

This comment was marked as spam.

):
for name, message in get_messages(module).items():
message.__module__ = 'google.cloud.spanner_admin_instance_v1.types'
setattr(sys.modules[__name__], name, message)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@theacodes
Copy link
Contributor

@lukesneeringer this should be ready to review and merge. While the changes to the library itself are minor, there had to be a lot of changes to the tests to remove gax as they were extremely tightly coupled.

@theacodes theacodes added api: spanner Issues related to the Spanner API. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Jan 5, 2018
@theacodes
Copy link
Contributor

@lukesneeringer seems the generator spit out a bad docstring, see 78dc4b0.

@lukesneeringer
Copy link
Contributor Author

@lukesneeringer seems the generator spit out a bad docstring, see 78dc4b0.

My guess is that is the Markdown to Restructed Text conversion that we do, meaning it is a bug in pandoc (or pypandoc).

I will attempt to prove this and then file a bug with them.

@theacodes
Copy link
Contributor

I will attempt to prove this and then file a bug with them.

In the meantime, can you file a bug on toolkit for tracking?

@lukesneeringer
Copy link
Contributor Author

@theacodes
Copy link
Contributor

@lukesneeringer (cc @dhermes) so I've ran into something and I really don't know how to fix it.

The protos contain docstrings that are incompatible with autodoc.

Warning, treated as error:
/Users/jonwayne/workspace/google-cloud-python/.nox/docs/lib/python3.6/site-packages/google/cloud/spanner_v1/types.py:docstring of google.cloud.spanner_v1.types.TransactionOptions:2:Unexpected section title.

Transactions
============

Source string here: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/a44f6ceff101b338ae5c3e1718b378887ec6fd12/spanner/google/cloud/spanner_v1/proto/transaction_pb2.py#L372

This isn't something I can easily just edit back in place - there's entire prose docs in the proto. What should we do here?

@dhermes
Copy link
Contributor

dhermes commented Jan 8, 2018

there's entire prose docs in the proto. What should we do here?

I've run into this before and just edited the _pb2 file. AFAIK there is no "fast" / easy fix.

@theacodes
Copy link
Contributor

theacodes commented Jan 8, 2018

I this case I'd need to remove the entire thing.

@lukesneeringer
Copy link
Contributor Author

lukesneeringer commented Jan 8, 2018

This isn't something I can easily just edit back in place - there's entire prose docs in the proto. What should we do here?

I actually copied that entire doc to an entirely-separate RST file, replaced that huge section of the docstring with a reference, and gave Spanner a bug to please change it (internal: 65243734).

@theacodes
Copy link
Contributor

Thanks, @lukesneeringer.

We should be good to review and merge after 8e11b2d

@theacodes
Copy link
Contributor

@lukesneeringer gentle ping - this should be ready to merge.

@lukesneeringer
Copy link
Contributor Author

Agreed.

@lukesneeringer lukesneeringer merged commit d2ff0b9 into master Jan 10, 2018
@lukesneeringer lukesneeringer deleted the spanner-regen branch January 10, 2018 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants