Skip to content

Commit 4a0bdd4

Browse files
committed
fixed path of files
1 parent c249d67 commit 4a0bdd4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+58
-50
lines changed

sdk/Table/__init__.py

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
__all__ = [
2+
'generate_account_sas',
3+
]
4+
5+
from azure.table import generate_account_sas

sdk/Table/azure/storage/tables/_shared/authentication.py renamed to sdk/Table/azure/azure_table/_shared/authentication.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import logging
88
import sys
9-
from os import name
109

1110
try:
1211
from urllib.parse import urlparse, unquote, parse_qsl
@@ -31,7 +30,7 @@
3130
_sign_string,
3231
)
3332

34-
from azure.storage.tables._shared._constants import (
33+
from azure.table import (
3534
DEV_ACCOUNT_NAME,
3635
DEV_ACCOUNT_SECONDARY_NAME
3736
)

sdk/Table/azure/storage/tables/_table_service_client.py renamed to sdk/Table/azure/azure_table/_table_service_client.py

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from urllib.parse import urlparse
22

3-
from azure.storage.tables._generated import AzureTable
4-
from azure.storage.tables._generated.models import TableProperties
5-
from azure.storage.tables._shared.base_client import StorageAccountHostsMixin, parse_connection_str, parse_query
6-
from azure.storage.tables._version import VERSION
3+
from azure.table import AzureTable
4+
from azure.table import TableProperties
5+
from azure.table import StorageAccountHostsMixin, parse_connection_str, parse_query
6+
from azure.table import VERSION
77

88

99
class TableServiceClient(StorageAccountHostsMixin):
@@ -42,7 +42,7 @@ def from_connection_string(
4242
credential=None, # type: Optional[Any]
4343
**kwargs # type: Any
4444
): # type: (...) -> TableServiceClient
45-
"""Create QueueServiceClient from a Connection String.
45+
"""Create TableServiceClient from a Connection String.
4646
4747
:param str conn_str:
4848
A connection string to an Azure Storage account.
@@ -51,8 +51,8 @@ def from_connection_string(
5151
account URL already has a SAS token, or the connection string already has shared
5252
access key values. The value can be a SAS token string, an account shared access
5353
key, or an instance of a TokenCredentials class from azure.identity.
54-
:returns: A Queue service client.
55-
:rtype: ~azure.storage.queue.QueueClient
54+
:returns: A Table service client.
55+
:rtype: ~azure.storage.table.TableClient
5656
5757
.. admonition:: Example:
5858
@@ -79,6 +79,34 @@ def delete_table(self, table_name):
7979
return response
8080

8181
def query_table(self, table_name):
82-
response = self._client.table.query_entities(table_name=table_name)
82+
# somehow use self._query_string to query things
83+
response = self._client.table.query(table_name=table_name)
8384
return response
8485

86+
def query_table_entities(self, table_name):
87+
response = self._client.table.query_entities(table_name=table_name)
88+
89+
def query_table_entities_with_partition_and_row_key(self, table_name):
90+
response = self._client.table.query_entities_with_partition_and_row_key(table_name=table_name)
91+
92+
def insert_entity(self):
93+
response = self._client.table.insert_entity()
94+
95+
def delete_entity(self):
96+
response = self._client.table.delete_entity()
97+
98+
def merge_entity(self):
99+
response = self._client.table.merge_entity()
100+
101+
def update_entity(self):
102+
response = self._client.table.update_entity()
103+
104+
def get_access_policy(self):
105+
response = self._client.table.get_access_policy()
106+
107+
def set_access_policy(self):
108+
response = self._client.table.set_access_policy()
109+
110+
def batch(self, *reqs):
111+
response = self.batch(*reqs)
112+
return response

sdk/Table/azure/storage/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

sdk/Table/azure/storage/tables/__init__.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

sdk/Table/samples/create_batch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
class CreateBatch(object):
22
def build_batch_operations(self):
33
from azure.storage.tables import TableServiceClient
4+
table_client = TableServiceClient(account_url=self.account_url,credential=self.credential)
5+
batch_operations = table_client.batch(*self.reqs)

sdk/Table/tests/_shared/testcase.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
# license information.
66
# --------------------------------------------------------------------------
77
from __future__ import division
8-
from contextlib import contextmanager
9-
import copy
10-
import inspect
118
import os
129
import os.path
1310
import time
1411
from datetime import datetime, timedelta
1512

16-
from azure.storage.tables import generate_account_sas
17-
from azure.storage.tables._shared.models import ResourceTypes, AccountSasPermissions
13+
from azure.azure_table import generate_account_sas
14+
from azure.azure_table._shared.models import ResourceTypes, AccountSasPermissions
15+
1816
from pyparsing import basestring
1917

2018
try:
@@ -23,9 +21,7 @@
2321
import mock
2422

2523
import zlib
26-
import math
2724
import sys
28-
import string
2925
import random
3026
import re
3127
import logging
@@ -36,7 +32,8 @@
3632
StorageAccountPreparer,
3733
FakeResource,
3834
)
39-
from azure_devtools.scenario_tests import RecordingProcessor, AzureTestError, create_random_name
35+
from azure_devtools.scenario_tests import RecordingProcessor, AzureTestError
36+
4037
try:
4138
from cStringIO import StringIO # Python 2
4239
except ImportError:

sdk/Table/tests/recordings/test_table.test_create_table.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ interactions:
1515
DataServiceVersion:
1616
- '3.0'
1717
Date:
18-
- Thu, 28 May 2020 14:13:36 GMT
18+
- Fri, 29 May 2020 14:04:04 GMT
1919
User-Agent:
20-
- azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.18362-SP0)
20+
- azsdk-python-storage-table/2019-07-07 Python/3.8.3 (Windows-10-10.0.19041-SP0)
2121
x-ms-date:
22-
- Thu, 28 May 2020 14:13:36 GMT
22+
- Fri, 29 May 2020 14:04:04 GMT
2323
x-ms-version:
2424
- '2019-07-07'
2525
method: POST
@@ -33,7 +33,7 @@ interactions:
3333
content-type:
3434
- application/json;odata=minimalmetadata;streaming=true;charset=utf-8
3535
date:
36-
- Thu, 28 May 2020 14:13:35 GMT
36+
- Fri, 29 May 2020 14:04:02 GMT
3737
location:
3838
- https://storagename.table.core.windows.net/Tables('myTable')
3939
server:

sdk/Table/tests/test_table.py

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,31 @@
55
# Licensed under the MIT License. See License.txt in the project root for
66
# license information.
77
# --------------------------------------------------------------------------
8-
import base64
9-
import hashlib
10-
import hmac
11-
from collections import namedtuple
12-
import unittest
138
import pytest
149
import sys
1510
import locale
1611
import os
17-
from azure.storage.tables import TableServiceClient
12+
from azure.azure_table import TableServiceClient
1813
from time import time
1914
from wsgiref.handlers import format_date_time
20-
from dateutil.tz import tzutc
2115
from datetime import (
2216
datetime,
2317
timedelta,
24-
date,
2518
)
26-
from devtools_testutils import ResourceGroupPreparer, StorageAccountPreparer
27-
from azure.mgmt.storage.models import Endpoints
2819
from azure.core.pipeline import Pipeline
2920
from azure.core.pipeline.policies import (
3021
HeadersPolicy,
3122
ContentDecodePolicy,
3223
)
3324

34-
from _shared.testcase import GlobalStorageAccountPreparer, TableTestCase, LogCaptured
3525

36-
from azure.storage.tables._shared.authentication import SharedKeyCredentialPolicy
26+
from _shared.testcase import TableTestCase, GlobalStorageAccountPreparer
27+
from azure.azure_table._shared.authentication import SharedKeyCredentialPolicy
3728
from azure.core.pipeline.transport import RequestsTransport
3829
from azure.core.exceptions import (
3930
HttpResponseError,
4031
ResourceNotFoundError,
41-
ResourceExistsError,
42-
ClientAuthenticationError)
32+
ResourceExistsError)
4333

4434
# from azure.tables import (
4535
# TableServiceClient,
@@ -52,14 +42,8 @@
5242
# generate_table_sas
5343
# )
5444

55-
from azure.storage.tables._generated import (
56-
AzureTable,
57-
)
58-
59-
from azure.storage.tables._generated.models._models_py3 import TableProperties
60-
6145
# ------------------------------------------------------------------------------
62-
from webencodings import Encoding
46+
6347

6448
TEST_TABLE_PREFIX = 'pytablesync'
6549

0 commit comments

Comments
 (0)