ahmedabu98 commented on code in PR #28624:
URL: https://github.com/apache/beam/pull/28624#discussion_r1334885838
##########
sdks/python/apache_beam/io/gcp/bigtableio_it_test.py:
##########
@@ -232,6 +235,8 @@ def test_set_mutation(self):
'col_fam', b'col-1', row2_col1_cell.value, row2_col1_cell.timestamp)
row2.set_cell(
'col_fam', b'col-2', row2_col2_cell.value, row2_col2_cell.timestamp)
+ # don't set a timestamp here. it should default to -1
+ row2.set_cell('col_fam', b'col-no-timestamp', row2_col1_no_timestamp.value)
Review Comment:
I'm not sure if explicitly setting `-1` microsecond is possible here.
DirectRow's `set_cell` requires a datetime.datetime object and I tried using
`datetime(year=1969, month=12, day=31, hour=23, minute=59, second=59,
microsecond=999_999)` and taking a peek at the mutation. It gives the following:
```
[set_cell {
family_name: "col_fam_test"
column_qualifier: "col"
timestamp_micros: -1000
value: "value"
}
]
```
This is because the client library converts the datetime object to micros
then truncates the millis
[here](https://github.com/googleapis/python-bigtable/blob/e5af3597f45fc4c094c59abca876374f5a866c1b/google/cloud/bigtable/row.py#L168-L170)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]