Skip to content

Commit

Permalink
[Tables] Remove extra data from TableItem (#18458)
Browse files Browse the repository at this point in the history
* removed extras from tableItem, added awaits to two tests that were missing them

* changelog
  • Loading branch information
seankane-msft authored May 3, 2021
1 parent 43cb948 commit d0fa0d6
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions sdk/tables/azure-data-tables/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* `TableClient.send_batch` has been renamed to `TableClient.submit_transaction`.
* Removed `BatchTransactionResult` object in favor of returning an iterable of batched entities with returned metadata.
* `BatchErrorException` has been renamed to `TableTransactionError`.
* Removed `date` and `api_version` from the `TableItem` class.

**Fixes**
* Fixed issue with Cosmos merge operations.
Expand Down
8 changes: 1 addition & 7 deletions sdk/tables/azure-data-tables/azure/data/tables/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,20 +492,14 @@ class TableItem(object):
Returned by TableServiceClient.list_tables and TableServiceClient.query_tables.
:ivar str name: The name of the table.
:ivar str api_version: The API version included in the service call
:ivar str date: The date the service call was made
"""

def __init__(self, name, **kwargs):
def __init__(self, name, **kwargs): # pylint: disable=unused-argument
# type: (str, Dict[str, Any]) -> None
"""
:param str name: Name of the Table
:keyword str api_version: The API version included in the service call
:keyword str date: The date the service call was made
"""
self.name = name
self.api_version = kwargs.get("version")
self.date = kwargs.get("date") or kwargs.get("Date")

@classmethod
def _from_generated(cls, generated, **kwargs):
Expand Down
1 change: 0 additions & 1 deletion sdk/tables/azure-data-tables/tests/test_table_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ async def test_query_tables_with_filter(self, tables_storage_account_name, table
assert len(tables) == 1
for table_item in tables:
assert isinstance(table_item, TableItem)
assert table_item.date is not None
assert table_item.name is not None
await ts.delete_table(table.table_name)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ async def test_query_user_filter_binary(self, tables_storage_account_name, table

assert length == 1
finally:
self._tear_down()
await self._tear_down()

@TablesPreparer()
async def test_query_user_filter_int64(self, tables_storage_account_name, tables_primary_storage_account_key):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ async def test_query_user_filter_binary(self, tables_cosmos_account_name, tables

assert length == 1
finally:
self._tear_down()
await self._tear_down()

@CosmosPreparer()
async def test_query_user_filter_int64(self, tables_cosmos_account_name, tables_primary_cosmos_account_key):
Expand Down

0 comments on commit d0fa0d6

Please sign in to comment.