google-cloud-python icon indicating copy to clipboard operation
google-cloud-python copied to clipboard

Support filter on labels for dataproc ListBatchesRequest

Open vhnguyenae opened this issue 10 months ago • 4 comments

Determine this is the right repository

  • [x] I determined this is the correct repository in which to report this feature request.

Summary of the feature request

Currently the python client does not support the filter on labels, only batch_id, batch_uuid, state, and create_time. https://cloud.google.com/python/docs/reference/dataproc/latest/google.cloud.dataproc_v1.types.ListBatchesRequest Meanwhile the api already supported filter on labels: https://cloud.google.com/dataproc-serverless/docs/reference/rpc/google.cloud.dataproc.v1

Current behaviour:

Filter on labels does not throw an error like when using unsupported field, but it returns empty result instead.

Desired code experience

        request = dataproc_v1.ListBatchesRequest(
            parent=parent,
            filter=f"labels.goog-dataproc-location = 'us-east4'",
            order_by="create_time desc"
        )

Expected results

Filter on labels should return the items that matched with the filter on labels.

Use case

This feature would be useful in a scenario where I need to filter on labels of the dataproc batch job.

vhnguyenae avatar Mar 19 '25 02:03 vhnguyenae

Hello @vhnguyenae,

Please could you try out a similar request in the Try this method interface on this page and check whether the issue still exists? This helps to confirm if this is a client library issue or a API issue. If this is an issue with the API itself, we'll redirect you to the API specific issue tracking page so you can file a bug and obtain better quality answers. For the Dataproc API , the public issue tracker is located at https://issuetracker.google.com/issues/new?component=187133&template=0.

parthea avatar Mar 19 '25 14:03 parthea

Hello @parthea , thanks for the feedback. I tried the API with the same labels filter and I can get a non empty list results. So I think the problem is from the client library 😁

Image

vhnguyenae avatar Mar 21 '25 01:03 vhnguyenae

Thank you, @vhnguyenae! We'll investigate and provide a fix.

parthea avatar Mar 21 '25 15:03 parthea

Hi @parthea , I would like to know if you have any update on this? 😁

vhnguyenae avatar May 05 '25 07:05 vhnguyenae