Skip to content

Cloud Bigtable: CheckAndMutateRow : ExactValueFilter #15327

Description

@sumith-tempus

Steps to reproduce

  1. Run the given code example to re-produce the error

ExactValueFilter is a subclass of ValueRegexFilter but I think I believe it should not care about when the filter is ExactValueFilter. I am not quite confident whether this is an issue or a feature request.

I am trying to understand, Is there a way to do CheckAndMutateRow for the column value(update if and only if the value is changed)

Code example

client=bigtable.Client()
instance=client.instance("instance-name")
table_id="table-name"table=instance.table(table_id)
row_key="row_key_1"col_name="col_name1"cell_val="test(value.pdf"col1_filter=row_filters.ColumnQualifierRegexFilter(col_name)
label1_filter=row_filters.ExactValueFilter(cell_val)
chain1=row_filters.RowFilterChain(filters=[col1_filter, label1_filter])
row_obj=table.conditional_row(row_key, filter_=chain1)
row_obj.set_cell("test_family_1", col_name, cell_val, state=False)
row_obj.commit()

Stack trace

/var/folders/t7/znmnfd3x2191zm8hybnnt5fx8zypkn/T/ipykernel_49224/1449758387.py in <module>
----> 1 row_obj.commit()
/usr/local/lib/python3.9/site-packages/google/cloud/bigtable/row.py in commit(self)
590 591 data_client = self._table._instance._client.table_data_client
--> 592 resp = data_client.check_and_mutate_row(
593 table_name=self._table.name,
594 row_key=self._row_key,
/usr/local/lib/python3.9/site-packages/google/cloud/bigtable_v2/services/bigtable/client.py in check_and_mutate_row(self, request, table_name, row_key, predicate_filter, true_mutations, false_mutations, app_profile_id, retry, timeout, metadata)
999 1000 # Send the request.
-> 1001 response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
1002 1003 # Done; return the response.
/usr/local/lib/python3.9/site-packages/google/api_core/gapic_v1/method.py in __call__(self, *args, **kwargs)
143 kwargs["metadata"] = metadata
144 --> 145 return wrapped_func(*args, **kwargs)
146 147 /usr/local/lib/python3.9/site-packages/google/api_core/grpc_helpers.py in error_remapped_callable(*args, **kwargs)
67 return callable_(*args, **kwargs)
68 except grpc.RpcError as exc:
---> 69 six.raise_from(exceptions.from_grpc_error(exc), exc)
70 71 return error_remapped_callable
/usr/local/lib/python3.9/site-packages/six.py in raise_from(value, from_value)
InvalidArgument: 400 Error in chained row filter googleapis/python-bigtable#1 : Error in field 'value_regex_filter' : Invalid RE2 regular expression 'test(value.pdf': missing ): test(value.pdf

Happy to Provide more information if needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    🚨This issue needs some love.api: bigtableIssues related to the Bigtable API.priority: p2Moderately-important priority. Fix may not be included in next release.triage meI really want to be triaged.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions