Repository: googleapis/google-cloud-python

Issue:
BigTable Row Data cells property not copy
 **Is your feature request related to a problem? Please describe.**
I was profiling the code I wrote that makes use of the BigTable client python API. I realised that it made a lot of calls to `deepcopy` and that these calls were very costly. It's actually because the `cells` property of a [row data](https://googleapis.github.io/google-cloud-python/latest/bigtable/row-data.html#cells) is actually returning a deep copy of the actual private `_cells` property. The fact is that I don't need all the cells information and I am only using it once so I don't really need the copy.

 **Describe the solution you'd like**
I think it would be nice to have the possibility to return the `_cells` property directly without copying. I imagine there are reasons why it has been coded like that, not offering the alternative, but I don't see them.

 **Describe alternatives you've considered**
Of course a hacky solution is to access directly the private property but it doesn't look like the right way to do it (i.e. `row._cells`).



Discussion:
@zaccharieramzi: You can use the [`find_cells`](https://github.com/googleapis/google-cloud-python/blob/9d6e68fad8129da6e2e7eef75e3c53454b623b69/bigtable/google/cloud/bigtable/row_data.py#L195) and [`cell_value`](https://github.com/googleapis/google-cloud-python/blob/9d6e68fad8129da6e2e7eef75e3c53454b623b69/bigtable/google/cloud/bigtable/row_data.py#L226) methods to reduce the deepcopy.

@tseaver: the `deepcopy` issue continues to be a source of consternation.  We've been through this before (#4468).  This will continue to be a source of performance issues for users.  Can we remove the `deepcopy`?
Thanks for the tip, it will indeed fix some of my use cases.

However when I want to access all columns (whose names I don't necessarily know in advance) it won't work. 

I think the `deepcopy` was introduced because of the [`clear`](https://github.com/googleapis/google-cloud-python/commit/163e98b52cc45ad3b819169b57c7072a3bc53089), but I don't think it's here anymore.
@sduskis I thought y'all had already removed the `deepcopy` bits.

Resolving patch:
diff --git a/bigtable/google/cloud/bigtable/row_data.py b/bigtable/google/cloud/bigtable/row_data.py
--- a/bigtable/google/cloud/bigtable/row_data.py
+++ b/bigtable/google/cloud/bigtable/row_data.py
@@ -181,7 +181,7 @@ def cells(self):
                   and second for column names/qualifiers within a family). For
                   a given column, a list of :class:`Cell` objects is stored.
         """
-        return copy.deepcopy(self._cells)
+        return self._cells
 
     @property
     def row_key(self):


Test patch:
diff --git a/bigtable/tests/unit/test_row_data.py b/bigtable/tests/unit/test_row_data.py
--- a/bigtable/tests/unit/test_row_data.py
+++ b/bigtable/tests/unit/test_row_data.py
@@ -305,8 +305,6 @@ def test_cells_property(self):
         partial_row_data = self._make_one(None)
         cells = {1: 2}
         partial_row_data._cells = cells
-        # Make sure we get a copy, not the original.
-        self.assertIsNot(partial_row_data.cells, cells)
         self.assertEqual(partial_row_data.cells, cells)
 
     def test_row_key_getter(self):