profile
viewpoint
Dov Shlachter software-dov Google

googleapis/gapic-generator-python 71

Generate Python API client libraries from Protocol Buffers.

googleapis/protoc-docs-plugin 14

A protoc plugin that appends docstrings to Message subclasses on the default Python pb2 generated output.

japacible/DashTricks-Pakistan 12

Android application focused on vaccine cold chain management in Pakistan.

rea2000/santalist 0

Santa wants everyone to submit their wish lists here. You can even add things other people's lists if you have a good idea of a gift for them.

software-dov/api-common-protos 0

A standard library for use in specifying protocol buffer APIs.

software-dov/artman 0

Artifact Manager, a build and packaging tool for Google API client libraries.

software-dov/flatbuffers 0

Memory Efficient Serialization Library

pull request commentgoogleapis/python-api-core

chore: release 2.3.0

A pre-release is fine; I want to be able to require this version in a pre-release surface.

release-please[bot]

comment created time in 3 days

PullRequestReviewEvent

pull request commentgoogleapis/python-api-core

chore: release 2.3.0

It's now past the 1st but not yet the 13th. Can we unblock the merge?

release-please[bot]

comment created time in 3 days

PullRequestReviewEvent

Pull request review commentgoogleapis/gapic-generator-python

fix: ensure rest unit tests have complete coverage

 def test_{{ method_name }}_rest(transport: str = 'rest', request_type={{ method.     {% endif %}  +    {% if method.input.required_fields %}

It might be reasonable to have a test or two just for the hidden required fields update method.

kbandes

comment created time in 5 days

Pull request review commentgoogleapis/gapic-generator-python

fix: ensure rest unit tests have complete coverage

 class {{service.name}}RestTransport({{service.name}}Transport):     {% endif %}{# service.has_lro #}     {% for method in service.methods.values() %}     {%- if method.http_options and not (method.server_streaming or method.client_streaming) %}++    {% if method.input.required_fields %}+    @staticmethod+    def _{{ method.name | snake_case }}_populate_required_fields(message_dict):

I would prefer it if we moved mutation to the caller, something like

__{{ method.name | snake_case }}_required_fields_default_values =  {
    {% for req_field in method.input.required_fields if req_field.is_primitive %}
        "{{ req_field.name | camel_case }}" : {% if req_field.field_pb.default_value is string %}"{{req_field.field_pb.default_value }}"{% else %}{{ req_field.field_pb.default_value }}{% endif %}{# default is str #}
    {% endfor %}
}


def _{{ method.name | snake_case }}_get_unset_required_fields(message_dict):
    return {k, v for k, v in __{{ method.name | snake_case }}_required_fields_default_values.items() if k not in message_dict}

    ....
    query_params.update(self._{{ method.name | snake_case }}_get_unset_required_fields(query_params)
kbandes

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

push eventgoogleapis/gapic-generator-python

Dov Shlachter

commit sha 3d00ba4e888ea51bb6e43b59d7747323bad06486

ci: save pip cache for multi-python jobs (#1095)

view details

push time in 13 days

push eventsoftware-dov/gapic-generator-python

Dov Shlachter

commit sha 98bc4315e1c61ed470127aafc8f6b3708cb8e628

Use python setup cache

view details

push time in 13 days

PullRequestReviewEvent

push eventsoftware-dov/gapic-generator-python

Ken Bandes

commit sha 6b640afbd93ea8c861b902211dc34e188234d072

fix: methods returning Operation w/o operation_info are now allowed. (#1047) Formerly, a method that returned google.longrunning.Operation but did not have the google.longrunning.operation_info extension was considered an error; but there are valid cases for this, particularly in the Operation service itself. This change makes it acceptable to have a method like this. It is not treated as a long-running operation. Co-authored-by: Kenneth Bandes <kbandes@google.com>

view details

Vadym Matsishevskyi

commit sha 8f213add4cb02366bb370ef46a686c6f0c37a575

fix: fix tests generation logic (#1049) * fix: fix tests generation logic This includes: 1) Fix test logic for grpc+rest case, when clients with both transports need to be initialized in parametrized tests 2) Fix 100% coverage problem for rest clients, when the http error (>= 400 error code) case logic was not covered. * fix integration testrs

view details

Anthonios Partheniou

commit sha 08cc2c4c85297759892782e307bcaa63dff41212

fix: add 'dict' type annotation to 'request' for async_client (#1051)

view details

release-please[bot]

commit sha 925b62a11103e93f427a4c3f50c8efc2737861c8

chore: release 0.53.4 (#1048) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

view details

Bu Sun Kim

commit sha e46f443dbeffe16b63f97668801b06189769e972

feat: generate code snippets by default (#1044)

view details

release-please[bot]

commit sha 03d8dadddce06b523454c3e49e3025b35411a660

chore: release 0.54.0 (#1054) :robot: I have created a release \*beep\* \*boop\* --- ## [0.54.0](https://www.github.com/googleapis/gapic-generator-python/compare/v0.53.4...v0.54.0) (2021-10-29) ### Features * generate code snippets by default ([#1044](https://www.github.com/googleapis/gapic-generator-python/issues/1044)) ([e46f443](https://www.github.com/googleapis/gapic-generator-python/commit/e46f443dbeffe16b63f97668801b06189769e972)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

view details

Dov Shlachter

commit sha 9d9b33dadf587a6d0b09031edeea597d6d2eae62

feat: add fragment tests (#1056) Fragment tests are defined by a small proto file describing an API surface with characteristics such that it is desirable to test the generated surface for correctness or to prevent regressions. As part of a fragment test, the generator is run on a fragment to create a GAPIC library for the fragment. The generated unit tests for the fragment are then executed to test the surface.

view details

release-please[bot]

commit sha 3923ca65c403b7286ddd5105ddf924cc3bae4911

chore: release 0.55.0 (#1059) :robot: I have created a release \*beep\* \*boop\* --- ## [0.55.0](https://www.github.com/googleapis/gapic-generator-python/compare/v0.54.0...v0.55.0) (2021-11-01) ### Features * add fragment tests ([#1056](https://www.github.com/googleapis/gapic-generator-python/issues/1056)) ([9d9b33d](https://www.github.com/googleapis/gapic-generator-python/commit/9d9b33dadf587a6d0b09031edeea597d6d2eae62)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

view details

WhiteSource Renovate

commit sha a8d2b3a2c11984d8677e4e6547a0cbb76d9ed915

chore(deps): update dependency protobuf to v3.19.1 (#1050) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [protobuf](https://developers.google.com/protocol-buffers/) | `==3.19.0` -> `==3.19.1` | [![age](https://badges.renovateapi.com/packages/pypi/protobuf/3.19.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/protobuf/3.19.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/protobuf/3.19.1/compatibility-slim/3.19.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/protobuf/3.19.1/confidence-slim/3.19.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-generator-python).

view details

Tres Seaver

commit sha d85dfadc180e5f218ad582a306c1c441a6c668db

fix: use (new) typing for 'gapic_v1.method.DEFAULT' (#1032) Relies on merge of https://github.com/googleapis/python-api-core/pull/292, but falls back to current (unsat) typing on older versions. Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>

view details

Bu Sun Kim

commit sha 185ecc7536db8309e6d2f03f9a66c36db18b1945

test: add tests for autogen-snippets option (#1055) Follow up to #1044

view details

Tres Seaver

commit sha e47faa6c59a1fadf7dfebc965c962aa05ca30f74

fix: suppress type error for fallback def of OptionalRetry (#1065) Introduced in #1032.

view details

Vadym Matsishevskyi

commit sha e3aa7a0b23bc4bfd5170753f74bdeac219902d1a

fix: fix missing http schema (http/https) for REST clients (#1063) * fix: fix missing http schema (http/https) for REST clients * update integration tests to match templates changes

view details

Ken Bandes

commit sha 0e379ca6c0aee9d79d11a14074b7e9343e9e6af2

fix: handle required fields properly in query_params (#1068) * fix: Handle required fields with default values in query params. * fix: add host portion of url to unit tests. Co-authored-by: Kenneth Bandes <kbandes@google.com>

view details

Bu Sun Kim

commit sha 4d0e36528a8eb23ea3893b0bbcca10b679867445

fix: leave a newline between field description and oneof line (#1071)

view details

Bu Sun Kim

commit sha c1a27f35f5c44e78d29f185e016de8b5f8c2cfaf

chore: make actools@ a CODEOWNER (#1069) Co-authored-by: Anthonios Partheniou <partheniou@google.com>

view details

Tres Seaver

commit sha 13f764c6513b91e7143a4a4a0bcc661cd19be0d8

fix: unignore 'google.api_core' imports (#1066)

view details

release-please[bot]

commit sha d3556d7486f1b7ef2e2e03e204c96c490a97123a

chore: release 0.55.1 (#1062) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

view details

Dov Shlachter

commit sha 905c0feea5af83add12dcb57f6857b715c356b90

chore: add bazel caching to integration tests (#1058) The integration test CI takes ~8 minutes to run, most of which is installing bazel and setting up tool dependencies. It is a massive time optimization to cache this work and prevent its re-creation on subsequent builds.

view details

Bu Sun Kim

commit sha a110e1d8387ea37b85ab0621bacd30da175fe85b

feat(snippetgen): turn resource path strings into f-strings (#1012) Fixes #965. Uses the already-existing resource path logic for autogen snippets. Previous: ```py # Initialize request argument(s) request = asset_v1.DeleteFeedRequest( name="projects/{project}/feeds/{feed}", ) ``` Now: ```py # Initialize request argument(s) project = "my-project-id" feed = "feed_value" name = f"projects/{project}/feeds/{feed}" request = asset_v1.DeleteFeedRequest( name=name, ) ``` Note: The logic may result in multiple variables with the same name (it doesn't happen for any of the golden APIs, but might for an API with more required fields).

view details

push time in 13 days

pull request commentgoogleapis/python-api-core

feat: add operations rest client to support long-running operations.

alternate http specifications to drop into the Operations rest transport

This right here seems to be a showstopper. Okay, I'm convinced that this would be a seriously non-trivial thing to do. Let's leave it as a future or never problem, then.

kbandes

comment created time in 13 days

PullRequestReviewEvent

push eventsoftware-dov/gapic-generator-python

Dov Shlachter

commit sha b828ca64641824c6501ce1e174368c3a2c98eb2e

Remove matrix categorization from step ID

view details

push time in 14 days

create barnchsoftware-dov/gapic-generator-python

branch : pip-cache

created branch time in 14 days

pull request commentgoogleapis/gapic-generator-python

feat: add support for long-running operations with rest transport.

Looks good, just two minor nits that shouldn't block the merge. Feel free to integrate them or ignore them.

kbandes

comment created time in 14 days

PullRequestReviewEvent

Pull request review commentgoogleapis/gapic-generator-python

feat: add support for long-running operations with rest transport.

 def services(self) -> Mapping[str, wrappers.Service]:                                     *[p.services for p in self.protos.values()],                                     ) +    @cached_property+    def http_options(self) -> Mapping[str, wrappers.HttpRule]:+        """Return a map of API-wide http rules."""++        def make_http_options(rule: http_pb2.HttpRule+                              ) -> Sequence[wrappers.HttpRule]:+            http_options = [rule] + list(rule.additional_bindings)+            opt_gen = (wrappers.HttpRule.try_parse_http_rule(http_rule)+                       for http_rule in http_options)+            return [rule for rule in opt_gen if rule]++        result = {}+        for rule in self.service_yaml_config.http.rules:+            result[rule.selector] = make_http_options(rule)

Nit: we can do

result = {
    rule.selector: make_http_options(rule)
    for rule in self.service_yaml_config.http_rules
}
kbandes

comment created time in 14 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentgoogleapis/gapic-generator-python

feat: add support for long-running operations with rest transport.

 def tweak_path(p):             add_iam_methods=bool(opts.pop('add-iam-methods', False)),             metadata=bool(opts.pop('metadata', False)),             # transport should include desired transports delimited by '+', e.g. transport='grpc+rest'-            transport=opts.pop('transport', ['grpc'])[0].split('+')+            transport=opts.pop('transport', ['grpc'])[0].split('+'),+            service_yaml_config=service_yaml_config

Nit: please add a trailing comma

kbandes

comment created time in 14 days

Pull request review commentgoogleapis/python-api-core

feat: add support for 'error_info'

 def from_http_response(response):     errors = payload.get("error", {}).get("errors", ())     # In JSON, details are already formatted in developer-friendly way.     details = payload.get("error", {}).get("details", ())-+    error_info = list(+        filter(+            lambda detail: detail.get("@type", "")+            == "type.googleapis.com/google.rpc.ErrorInfo",+            details,+        )+    )

Nit: it's more idiomatic to use list comprehensions than list and filter.

error_info_type = "type.googleapis.com/google.rpc.ErrorInfo"
error_info = [d for d in details if d.get("@type", "") == error_info_type]
atulep

comment created time in 17 days

Pull request review commentgoogleapis/python-api-core

feat: add support for 'error_info'

 def errors(self):         """         return list(self._errors) +    @property+    def reason(self):+        """The reason of the error.++        Reference:+            https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L112++        Returns:+            Union[str, None]: An optional string containing reason of the error.+        """+        if not self._error_info:+            return None+        return self._error_info.reason++    @property+    def domain(self):+        """The logical grouping to which the "reason" belongs.++        Reference:+            https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L112++        Returns:+            Union[str, None]: An optional string containing a logical grouping to which the "reason" belongs.+        """+        if not self._error_info:+            return None+        return self._error_info.domain

Same here: we can use conditional expressions

atulep

comment created time in 17 days

Pull request review commentgoogleapis/python-api-core

feat: add support for 'error_info'

 def errors(self):         """         return list(self._errors) +    @property+    def reason(self):+        """The reason of the error.++        Reference:+            https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L112++        Returns:+            Union[str, None]: An optional string containing reason of the error.+        """+        if not self._error_info:+            return None+        return self._error_info.reason++    @property+    def domain(self):+        """The logical grouping to which the "reason" belongs.++        Reference:+            https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L112++        Returns:+            Union[str, None]: An optional string containing a logical grouping to which the "reason" belongs.+        """+        if not self._error_info:+            return None+        return self._error_info.domain++    @property+    def metadata(self):+        """Additional structured details about this error++        Reference:+            https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L112++        Returns:+            Union[Dict[str, str], None]: An optional object containing structured details about the error.+        """+        if not self._error_info:+            return None+        return self._error_info.metadata

And here, same as above.

atulep

comment created time in 17 days

Pull request review commentgoogleapis/python-api-core

feat: add support for 'error_info'

 def errors(self):         """         return list(self._errors) +    @property+    def reason(self):+        """The reason of the error.++        Reference:+            https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L112++        Returns:+            Union[str, None]: An optional string containing reason of the error.+        """+        if not self._error_info:+            return None+        return self._error_info.reason

Nit: we can simplify this to

return self._error_info.reason if self._error_info else None
atulep

comment created time in 17 days

PullRequestReviewEvent
more