[DRAFT] chore(bigtable): add samples for sync client - #17820
[DRAFT] chore(bigtable): add samples for sync client#17820daniel-sanche wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds new Python samples and tests for the Google Cloud Bigtable admin and data clients, while updating legacy client samples with _legacy region tags. The review feedback highlights several critical API usage issues in the new data client snippets, including incorrect attribute access on Row and Cell objects, the use of the non-existent DeleteRangeFromColumn class (which should be DeleteCells), and type mismatches where regex filters expect bytes instead of strings (or vice-versa). Additionally, the feedback suggests minor cleanups for unused imports, unused variables, and redundant fully qualified imports.
| query = ReadRowsQuery( | ||
| row_filter=row_filters.RowFilterUnion( | ||
| filters=[ | ||
| row_filters.ValueRegexFilter("true"), | ||
| row_filters.ColumnQualifierRegexFilter("os_build"), | ||
| ] | ||
| ) | ||
| ) |
There was a problem hiding this comment.
In the Python Bigtable data client, both ValueRegexFilter and ColumnQualifierRegexFilter expect bytes as their patterns because cell values and column qualifiers are stored as bytes. Passing strings will cause runtime errors or matching failures.
| query = ReadRowsQuery( | |
| row_filter=row_filters.RowFilterUnion( | |
| filters=[ | |
| row_filters.ValueRegexFilter("true"), | |
| row_filters.ColumnQualifierRegexFilter("os_build"), | |
| ] | |
| ) | |
| ) | |
| query = ReadRowsQuery( | |
| row_filter=row_filters.RowFilterUnion( | |
| filters=[ | |
| row_filters.ValueRegexFilter(b"true"), | |
| row_filters.ColumnQualifierRegexFilter(b"os_build"), | |
| ] | |
| ) | |
| ) |
This PR covers sample gaps between the sync data client/generated admin client
TODO: review