Skip to content
New issue

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

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

Already on GitHub? # to your account

proto-plus v1.24+ breaks google.cloud.dataplex_v1 client library #13479

Open
1 task done
solomon-grant opened this issue Jan 29, 2025 · 0 comments
Open
1 task done

proto-plus v1.24+ breaks google.cloud.dataplex_v1 client library #13479

solomon-grant opened this issue Jan 29, 2025 · 0 comments
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@solomon-grant
Copy link

Determine this is the right repository

  • I determined this is the correct repository in which to report this bug.

Summary of the issue

Context
The google-cloud-dataplex package depends on a protobuf wrapper package called proto-plus. Recent versions of the proto-plus dependency change the expected types of some google.cloud.dataplex_v1 objects.

In particular, when using proto-plus >= 1.24, the type of google.cloud.dataplex_v1.Aspect.data is proto.marshal.collections.maps.MapComposite rather than the documented google.protobuf.struct_pb2.Struct.

Expected Behavior:

The type of google.cloud.dataplex_v1.Aspect.data should be google.protobuf.struct_pb2.Struct. This works with proto-plus==1.23.0.

>>> from google.cloud import dataplex_v1
>>> client = dataplex_v1.CatalogServiceClient()
>>> entry = client.get_entry(name="my-entry-id")
>>> aspect = entry.aspects["my-aspect-id"]
>>> type(aspect.data)
<class 'google.protobuf.struct_pb2.Struct'>

Actual Behavior:

The type of google.cloud.dataplex_v1.Aspect.data is proto.marshal.collections.maps.MapComposite when using proto-plus>=1.24.0.

>>> from google.cloud import dataplex_v1
>>> client = dataplex_v1.CatalogServiceClient()
>>> entry = client.get_entry(name="my-entry-id")
>>> aspect = entry.aspects["my-aspect-id"]
>>> type(aspect.data)
<class 'proto.marshal.collections.maps.MapComposite'>

API client name and version

google-cloud-dataplex v2.6.0

Reproduction steps: code

file: main.py

from google.cloud import dataplex_v1

project_id = "my-google-cloud-project-id"
project_num = "my-google-cloud-project-number"
location = "my-google-cloud-region"

entry_group_id = "my-dataplex-catalog-entry-group-id"
aspect_type_id = "my-dataplex-catalog-aspect-type-id"
entry_id = "my-dataplex-entry-id"


def reproduce():
    client = dataplex_v1.CatalogServiceClient()
    entry_name = f"projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}"
    entry = client.get_entry(name=entry_name)
    aspect = entry.aspects[f"{project_num}.{location}.{aspect_type_id}"]
    print(type(aspect.data))


if __name__ == "__main__":
    reproduce()

Reproduction steps: supporting files

Reproduction steps: actual results

<class 'proto.marshal.collections.maps.MapComposite'>

Reproduction steps: expected results

<class 'google.protobuf.struct_pb2.Struct'>

OS & version + platform

No response

Python environment

Python 3.10.15

Python dependencies

google-cloud-dataplex 2.6.0
proto-plus 1.24.0

Additional context

This problem does not occur when using proto-plus v1.23.0.

@solomon-grant solomon-grant added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jan 29, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant