Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tables] Azure Data Tables SDK, sync and async code #12766

Merged
merged 361 commits into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
361 commits
Select commit Hold shift + click to select a range
cd1ba13
updated design of update and upsert methods
LibbaLawrence Jul 2, 2020
b4f53fe
fixed upsert/update
LibbaLawrence Jul 2, 2020
6acf215
reflected change to create_entity
LibbaLawrence Jul 2, 2020
afa22af
fixed problems with upsert function
LibbaLawrence Jul 2, 2020
5f88fa6
fixed upsert/update functions on async clients
LibbaLawrence Jul 2, 2020
776baa6
pausing on tests
LibbaLawrence Jul 2, 2020
21db1c6
fixed test failing on HttpResponse
LibbaLawrence Jul 2, 2020
1f6fb8c
fixing 2.7 errorZ
LibbaLawrence Jul 2, 2020
f97c6bb
trying to fix 2.7
LibbaLawrence Jul 2, 2020
58312c5
fixed tests
LibbaLawrence Jul 2, 2020
ad90b6e
removed problem with unbpund fucntion
LibbaLawrence Jul 2, 2020
8f58a13
track 1 async sdk
LibbaLawrence Jul 6, 2020
41e4c30
renamed aio to _aio
LibbaLawrence Jul 6, 2020
fef6a1a
updating comments
LibbaLawrence Jul 6, 2020
661e64e
tweaking comments and types for stub gen
LibbaLawrence Jul 6, 2020
0e153ea
fixed pylint issue
LibbaLawrence Jul 6, 2020
be808aa
fixed list_tables to query_tables
LibbaLawrence Jul 7, 2020
07f4a18
pylint errors
LibbaLawrence Jul 7, 2020
7527deb
fixing type errors
LibbaLawrence Jul 7, 2020
172a8d3
updating samples
LibbaLawrence Jul 7, 2020
a1a5bb6
fixing comments
LibbaLawrence Jul 7, 2020
fb37769
updating README
LibbaLawrence Jul 7, 2020
07481da
fixing PR comments on keyword and credential
LibbaLawrence Jul 7, 2020
685ce54
editing order of docstrings
LibbaLawrence Jul 7, 2020
7aef14c
fixing queue comments
LibbaLawrence Jul 7, 2020
a4cc685
fixing queue comments
LibbaLawrence Jul 7, 2020
0da6cb7
delete table has no return response
LibbaLawrence Jul 7, 2020
a3232e9
changing types to model types
LibbaLawrence Jul 7, 2020
b743848
added keys to dictionary
LibbaLawrence Jul 7, 2020
ac2891c
changing types to model types
LibbaLawrence Jul 7, 2020
db6d180
fixed stroage reference
LibbaLawrence Jul 7, 2020
c59d427
fixing docstring reutrn
LibbaLawrence Jul 7, 2020
ed06ec0
fixed cathc and raise same error
LibbaLawrence Jul 7, 2020
9d737a2
UpdateMode in init
LibbaLawrence Jul 7, 2020
bb8a47e
obj to _
LibbaLawrence Jul 7, 2020
514d733
fixing comments
LibbaLawrence Jul 7, 2020
8fb7513
fixed metadata return
LibbaLawrence Jul 7, 2020
aca49d2
fixed comments
LibbaLawrence Jul 7, 2020
3ce7dd0
fixing test error
LibbaLawrence Jul 7, 2020
8779648
fixed depedncies
LibbaLawrence Jul 7, 2020
cedd37d
fixing type
LibbaLawrence Jul 7, 2020
954902a
fixing stubgen error
LibbaLawrence Jul 7, 2020
7987bd0
changed to ivar
LibbaLawrence Jul 7, 2020
73d7c10
fixing type error
LibbaLawrence Jul 8, 2020
4763812
editing samples/ fixing pylint
LibbaLawrence Jul 8, 2020
ce5b6b9
reformatted service client sampels
LibbaLawrence Jul 8, 2020
cd1fe8e
added more official samples
LibbaLawrence Jul 8, 2020
554c48f
added in teh create and delete table in table client
LibbaLawrence Jul 8, 2020
04571c7
working on client samples
LibbaLawrence Jul 8, 2020
42b71f8
linked README to samples
LibbaLawrence Jul 8, 2020
e0f42ba
TODO for return types
LibbaLawrence Jul 8, 2020
482ac07
changed query entity to get entity
LibbaLawrence Jul 8, 2020
e4fcf39
edited README
LibbaLawrence Jul 8, 2020
16127fa
made UpdateMode into an enum
LibbaLawrence Jul 8, 2020
e7580c0
changed return type of cont token to dict
LibbaLawrence Jul 8, 2020
946965c
fixed readme common uses
LibbaLawrence Jul 8, 2020
2e9abe6
todos created
LibbaLawrence Jul 8, 2020
60420f0
fixed continuation token to a dictionary
LibbaLawrence Jul 9, 2020
d8babbd
fixed continuation error
LibbaLawrence Jul 9, 2020
cd42322
changed query to individual entries
LibbaLawrence Jul 9, 2020
b1d30c5
editing README pr comments
LibbaLawrence Jul 9, 2020
ecddf4d
removed AAD from readme
LibbaLawrence Jul 9, 2020
3fe73b0
removed TODO
LibbaLawrence Jul 9, 2020
7e356d6
getting rid of exposed secret
LibbaLawrence Jul 9, 2020
e655a5c
added design updates to async client
LibbaLawrence Jul 10, 2020
930532d
stahs
LibbaLawrence Jul 10, 2020
daba27c
fixed import
LibbaLawrence Jul 10, 2020
a3a80fe
fixed init file
LibbaLawrence Jul 10, 2020
8bdf4da
fixed import
LibbaLawrence Jul 10, 2020
317123b
added todo for table
LibbaLawrence Jul 13, 2020
3710160
added return type
LibbaLawrence Jul 14, 2020
2ef1ae1
editing table client return
LibbaLawrence Jul 14, 2020
47e5e8a
changed table name for table standards (Sean fix)
LibbaLawrence Jul 14, 2020
b1a6259
editing sas methods
LibbaLawrence Jul 14, 2020
a666f9e
work in progress - fixing pre api review comments
LibbaLawrence Jul 14, 2020
da62e6b
updated tests to work with fixes
LibbaLawrence Jul 14, 2020
bf52e40
re-running tests for verification'
LibbaLawrence Jul 14, 2020
c15672d
fixed small errors with changing method names
LibbaLawrence Jul 15, 2020
80fa9d1
fixed storgae_process_error -> table instead of storage, created meta…
LibbaLawrence Jul 15, 2020
74e860f
made metadata for entities separate from entity itself (see _entity.py)
LibbaLawrence Jul 15, 2020
46dcd22
updated readme and added regex check for table names on TableClient a…
seankane-msft Jul 15, 2020
a20532e
oops forgot to import re in the _table_client.py
seankane-msft Jul 15, 2020
dc67a98
metadata test passing
LibbaLawrence Jul 15, 2020
28f3fa4
fixed unimported entity
LibbaLawrence Jul 15, 2020
b97a649
added user defined filter option with parameters
LibbaLawrence Jul 15, 2020
c58032c
added user defined filter option with parameters
LibbaLawrence Jul 15, 2020
59e2408
changed the regex test to match to fit with python2
seankane-msft Jul 15, 2020
c1d9e25
fixed linting issues thrown by pylint
seankane-msft Jul 15, 2020
91622db
re-ran test
LibbaLawrence Jul 16, 2020
47c7d4b
updating samples part 1
LibbaLawrence Jul 16, 2020
e2e19f6
updating asserts part 2
LibbaLawrence Jul 16, 2020
8f4cc97
removing references to common
LibbaLawrence Jul 16, 2020
c7ff4b0
fixing sas on sample
LibbaLawrence Jul 16, 2020
78e9fa5
fixing import statement
LibbaLawrence Jul 16, 2020
500a6e2
attempting to fix dateutil error
LibbaLawrence Jul 16, 2020
f546351
trying to fix enum in entity property
LibbaLawrence Jul 16, 2020
31b68ee
fix #2 dateutil
LibbaLawrence Jul 16, 2020
e987dcf
attempting to fix dateutil error
LibbaLawrence Jul 16, 2020
30be2be
fixing test import
LibbaLawrence Jul 16, 2020
1f8e970
remove unuse import
LibbaLawrence Jul 16, 2020
c3399c0
added tests for table_client and table_service_client
seankane-msft Jul 16, 2020
19f5936
adding live recordings
seankane-msft Jul 16, 2020
9143b9d
Merge branch 'lilaw_table' of https://github.com/LibbaLawrence/azure-…
seankane-msft Jul 16, 2020
a799d47
fix #2 dateutil
LibbaLawrence Jul 16, 2020
18a57e7
updated dev_requirements, changed test name
seankane-msft Jul 16, 2020
a84bda3
py 2.7 doesnt have timezone - siwtch to UTC
LibbaLawrence Jul 16, 2020
8c79977
reverting back to libbas recordings
seankane-msft Jul 16, 2020
bff0099
reverting to using tzutc -- for now
LibbaLawrence Jul 17, 2020
22d6014
updating samples a little with error printing
LibbaLawrence Jul 17, 2020
4e46dca
replicated tzutc class with class Timezone
LibbaLawrence Jul 17, 2020
2b77e60
forgot to create table twice for error
LibbaLawrence Jul 17, 2020
3e04e54
changed regex to fxn in _error.py, added second assertion to tests, u…
seankane-msft Jul 17, 2020
af9d329
updating samples to reflect sdk part 1
LibbaLawrence Jul 17, 2020
76b25e3
commented out cryptogrpahy from encryption test
LibbaLawrence Jul 17, 2020
adb71c2
removed commented out code and changed the invalid table name
seankane-msft Jul 17, 2020
eec3a0c
updating docstrings
LibbaLawrence Jul 17, 2020
f53c793
'commented out references to cryptography
LibbaLawrence Jul 17, 2020
44009bf
commented out pylint errors related to encryption
LibbaLawrence Jul 17, 2020
5b24a15
updated delete entity to show etag
LibbaLawrence Jul 17, 2020
a6a7442
still finding encryption
LibbaLawrence Jul 17, 2020
d5413b0
removed list froma round itempaged
LibbaLawrence Jul 17, 2020
a60c5cd
commenting out test
LibbaLawrence Jul 17, 2020
12a5df3
Merge pull request #8 from seankane-msft/clarify-readme
seankane-msft Jul 17, 2020
6b0fbe1
commented out tests
LibbaLawrence Jul 17, 2020
4d5444c
fixed enum on edmtype
LibbaLawrence Jul 17, 2020
2fb43e2
updated update entity
LibbaLawrence Jul 20, 2020
3e25c1b
fixing apiview comments on sas
LibbaLawrence Jul 20, 2020
fd536b1
added table name to table clinet
LibbaLawrence Jul 20, 2020
27ac825
changing ItemPaged to ItemPaged[str[
LibbaLawrence Jul 20, 2020
8205d80
changing properties to private
LibbaLawrence Jul 20, 2020
776f85f
changes form apiview archboard pre meeting
LibbaLawrence Jul 20, 2020
9de490a
added filter type
LibbaLawrence Jul 20, 2020
05db919
TODO on from_string in SAS, fixed error in table querying ItemPaged r…
LibbaLawrence Jul 21, 2020
3b48674
changed name to _primary_hostname not primay_hopstname
LibbaLawrence Jul 21, 2020
a55d112
oops missed the other hostname
LibbaLawrence Jul 21, 2020
d13d9a5
oops missed the other other hostname
LibbaLawrence Jul 21, 2020
c7767cc
added a client base for tableclient and tableserviceclient, passes al…
seankane-msft Jul 21, 2020
5fab19c
fixed TODO on sas
LibbaLawrence Jul 21, 2020
24e640d
changes to satisfy linter
seankane-msft Jul 21, 2020
cdeb4a4
tweaking delete
LibbaLawrence Jul 21, 2020
0824c5d
moved account parsing to the base class, fixed more linting issues
seankane-msft Jul 21, 2020
5b57238
resolved comments
seankane-msft Jul 21, 2020
7c6640f
Merge pull request #9 from seankane-msft/base-table-client
seankane-msft Jul 21, 2020
9f47e1d
Merge branch 'lilaw_async' of https://github.com/LibbaLawrence/azure-…
seankane-msft Jul 21, 2020
4737ff6
updating samples
LibbaLawrence Jul 21, 2020
0966566
updating updatemode
LibbaLawrence Jul 21, 2020
8ac26b6
updating UpdateMode
LibbaLawrence Jul 21, 2020
80cbe26
Merge branch 'lilaw_table' of https://github.com/LibbaLawrence/azure-…
LibbaLawrence Jul 21, 2020
c8d2333
importing typing for union
LibbaLawrence Jul 21, 2020
430c699
initial commit for diff
seankane-msft Jul 21, 2020
f6802aa
Merge branch 'lilaw_table' of https://github.com/LibbaLawrence/azure-…
seankane-msft Jul 21, 2020
eb6f3f6
change to REPLACE'
LibbaLawrence Jul 21, 2020
7eabb9f
initial commit for pulling down current async status, ran a tests liv…
seankane-msft Jul 22, 2020
871788a
renamed entity tableentity
LibbaLawrence Jul 22, 2020
063abd2
allowed select to be array or str
LibbaLawrence Jul 22, 2020
85be966
made Table class
LibbaLawrence Jul 22, 2020
2b68bfb
renamed a new directory for azure-data-tables
LibbaLawrence Jul 22, 2020
7e72cd0
removing storgae reference
LibbaLawrence Jul 22, 2020
da032fc
changed query 'r' to read
LibbaLawrence Jul 22, 2020
bbf2df2
removing some commented out code
LibbaLawrence Jul 22, 2020
60f78f8
updating delete/create table comments
LibbaLawrence Jul 22, 2020
47f49c4
docstring return type for table
LibbaLawrence Jul 22, 2020
c3faee2
bullet point auth
LibbaLawrence Jul 22, 2020
5b2f443
base work for async models, working on passing last few tests, added …
seankane-msft Jul 22, 2020
7ed02cc
removing packages to exclude
LibbaLawrence Jul 22, 2020
e155515
fixing README
LibbaLawrence Jul 22, 2020
bf58264
adding to the blurb in the readme from the archboard pwpt
LibbaLawrence Jul 22, 2020
3b5f476
passing most async tests, issues with list_tables query_options curre…
seankane-msft Jul 22, 2020
2fe0a1b
fixing blank line
LibbaLawrence Jul 22, 2020
dff2bf7
making nspkg for data
LibbaLawrence Jul 22, 2020
9fd2098
removed async
LibbaLawrence Jul 22, 2020
674606a
changed to relative imports
LibbaLawrence Jul 22, 2020
12fd8de
:had to update naming
LibbaLawrence Jul 22, 2020
724c24d
stahs
LibbaLawrence Jul 22, 2020
9ebfd71
stahs
LibbaLawrence Jul 22, 2020
6cffbd0
had to fix list and query tables
LibbaLawrence Jul 22, 2020
6b16cdb
build mad about version
LibbaLawrence Jul 22, 2020
aec8585
changed version to match 1.0.0
LibbaLawrence Jul 22, 2020
ebc2d77
changed how results_per_page is passed in, need to verify with Libba …
seankane-msft Jul 22, 2020
32dbb11
forgot and init file - path was being skipped in build
LibbaLawrence Jul 23, 2020
72be007
changing list and query to align with new api view
seankane-msft Jul 23, 2020
728a4bd
passing the list_tables_with_num_results again
seankane-msft Jul 23, 2020
59a44f7
passes tests when run locally, does not pass in live-mode. the behavi…
seankane-msft Jul 23, 2020
49867a9
fixed test back
LibbaLawrence Jul 23, 2020
4327be0
hand to change query to list tables
LibbaLawrence Jul 23, 2020
841cbdd
temp fix on README error
LibbaLawrence Jul 23, 2020
db7246e
had to change msrest version
LibbaLawrence Jul 23, 2020
874dcb5
fixing pylint error
LibbaLawrence Jul 23, 2020
e6442f3
fixed all merge conflicts
seankane-msft Jul 23, 2020
ef06a44
Update README.md
LibbaLawrence Jul 23, 2020
12736e6
fixing more merge commits
seankane-msft Jul 23, 2020
de68693
ignorning nspkg readme
LibbaLawrence Jul 23, 2020
a3eeee4
Merge branch 'lilaw_table' of https://github.com/LibbaLawrence/azure-…
LibbaLawrence Jul 23, 2020
c9f36de
addressed Libbas comments
seankane-msft Jul 23, 2020
320a228
regenerated code
LibbaLawrence Jul 24, 2020
e95ea30
fixed Krista comments on readmes
LibbaLawrence Jul 24, 2020
086275c
fixing Krista comments
LibbaLawrence Jul 24, 2020
582fb26
fixed anna's changes
LibbaLawrence Jul 24, 2020
303a400
addressed all of izzys comments
seankane-msft Jul 24, 2020
3b64fa4
reran all tests and fixed a few bugs from pulling down
seankane-msft Jul 24, 2020
0f35848
removing unsued import
LibbaLawrence Jul 24, 2020
cf5db63
Merge pull request #10 from seankane-msft/async-tables-sean
LibbaLawrence Jul 24, 2020
aaf308e
fixing merge errors
LibbaLawrence Jul 24, 2020
5a4f784
fixing docstrings
LibbaLawrence Jul 24, 2020
0928b2a
fixewd docstring
LibbaLawrence Jul 24, 2020
70f564a
fixing docstrings
LibbaLawrence Jul 24, 2020
88f469b
fixing docs
LibbaLawrence Jul 24, 2020
8e5d2f7
verifying tests work:
LibbaLawrence Jul 24, 2020
0ec9e74
verifying tests'
LibbaLawrence Jul 24, 2020
a2dc16a
fixed sync for parameters
LibbaLawrence Jul 27, 2020
8f20ef8
fixed async clients parameters
LibbaLawrence Jul 27, 2020
83e0803
fixing error for mode
LibbaLawrence Jul 27, 2020
52293ac
fixing pylint errors
LibbaLawrence Jul 27, 2020
e0ff5fe
re running tests
LibbaLawrence Jul 27, 2020
95520f4
added more tests
LibbaLawrence Jul 27, 2020
56bec1e
fixing models for tests
LibbaLawrence Jul 27, 2020
5347710
fixed init
LibbaLawrence Jul 27, 2020
2b39a4f
had to fix fomratting of async docstring types
LibbaLawrence Jul 27, 2020
f97501d
fixed merge conflict
LibbaLawrence Jul 28, 2020
5d5b6f1
deleting stubgens
LibbaLawrence Jul 28, 2020
ed7eae0
fixing references to storage, and tokens
LibbaLawrence Jul 28, 2020
61ae728
working to refactor mentions of storage
LibbaLawrence Jul 28, 2020
95f3a12
making links to cosmos
LibbaLawrence Jul 28, 2020
ed99eb5
changed naming of header for changelog
LibbaLawrence Jul 29, 2020
78f60ec
added azure data init to include
LibbaLawrence Jul 29, 2020
c955ba8
fixed exposed model
LibbaLawrence Jul 29, 2020
9707551
fixed return of create table to be Table object
LibbaLawrence Jul 29, 2020
9283040
fixed return of create table to be Table object
LibbaLawrence Jul 29, 2020
6e80cb4
updated docstring
LibbaLawrence Jul 29, 2020
26c46b9
added try catch to code calls
LibbaLawrence Jul 29, 2020
7ce7cba
fixed exposed model
LibbaLawrence Jul 29, 2020
e9809f5
working on fixing error handling:
LibbaLawrence Jul 29, 2020
645a7ae
not overriding etag
LibbaLawrence Jul 29, 2020
4f717ef
fixed table entity metadata
LibbaLawrence Jul 29, 2020
c037092
editing table object
LibbaLawrence Jul 29, 2020
55fbdb1
fixing sas protocol
LibbaLawrence Jul 29, 2020
668da78
remvoed tables from aio model
LibbaLawrence Jul 29, 2020
679e0dd
removing identity
LibbaLawrence Jul 29, 2020
4d6ee29
adding comment to install requirement
LibbaLawrence Jul 29, 2020
dcc7db7
changing docstrings for edm type - making an issue to infer
LibbaLawrence Jul 29, 2020
f3b25e1
fixing pylint errro
LibbaLawrence Jul 29, 2020
64d5014
fixing readme
LibbaLawrence Jul 30, 2020
bff1f46
fixed tests for metadata
LibbaLawrence Jul 30, 2020
aa98b5f
removing links from REAMDE
LibbaLawrence Jul 30, 2020
3725ba0
fixing broken link
LibbaLawrence Jul 30, 2020
31fa994
fixing pylint
LibbaLawrence Jul 30, 2020
7a24ef9
trying to fix bandit fail
LibbaLawrence Jul 30, 2020
054afb3
trying to fix bandit fail
LibbaLawrence Jul 30, 2020
b1ed81d
oops forget to disable bandit check
LibbaLawrence Jul 30, 2020
d10d7af
adding back md5 with nosec
LibbaLawrence Jul 30, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ known_content_issues:
- ['sdk/storage/azure-storage-queue/samples/README.md', 'nspkg and common']
- ['sdk/textanalytics/azure-ai-nspkg/README.md', 'nspkg and common']
- ['sdk/eventhub/azure-eventhub/samples/README.md', 'nspkg and common']
- ['sdk/tables/azure-data-nspkg/README.md', 'nspkg and common']

# HISTORY.rst
- ['sdk/core/azure/HISTORY.rst','#4554']
Expand Down
3 changes: 3 additions & 0 deletions sdk/tables/azure-data-nspkg/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include *.md
include azure/__init__.py
include azure/data/__init__.py
11 changes: 11 additions & 0 deletions sdk/tables/azure-data-nspkg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Microsoft Azure Data SDK for Python

This is the Microsoft Azure Data namespace package.

This package is not intended to be installed directly by the end user.

It provides the necessary files for other packages to extend the
azure.data namespace.

If you are looking to install the Azure Data libraries, see the
[azure](https://pypi.python.org/pypi/azure) bundle package.
1 change: 1 addition & 0 deletions sdk/tables/azure-data-nspkg/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1 change: 1 addition & 0 deletions sdk/tables/azure-data-nspkg/azure/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
2 changes: 2 additions & 0 deletions sdk/tables/azure-data-nspkg/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal=1
45 changes: 45 additions & 0 deletions sdk/tables/azure-data-nspkg/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env python

# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import sys
from setuptools import setup

PACKAGES = []
# Do an empty package on Python 3 and not python_requires, since not everybody is ready
# https://github.com/Azure/azure-sdk-for-python/issues/3447
# https://github.com/Azure/azure-sdk-for-python/issues/3481
if sys.version_info[0] < 3:
PACKAGES = ['azure.data']

setup(
name='azure-data-nspkg',
version='1.0.0',
description="Microsoft Azure Data Namespace Package [Internal]",
long_description=open("README.md", "r").read(),
long_description_content_type="text/markdown",
license='MIT License',
author="Microsoft Corporation",
author_email="azpysdkhelp@microsoft.com",
url="https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/tables",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: MIT License",
],
zip_safe=False,
packages=PACKAGES,
install_requires=[
'azure-nspkg>=3.0.0',
]
)
6 changes: 6 additions & 0 deletions sdk/tables/azure-data-tables/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Release History

## 12.0.0b1 (Unreleased)
LibbaLawrence marked this conversation as resolved.
Show resolved Hide resolved



6 changes: 6 additions & 0 deletions sdk/tables/azure-data-tables/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include *.md
include azure/__init__.py
LibbaLawrence marked this conversation as resolved.
Show resolved Hide resolved
include azure/data/__init__.py
include LICENSE.txt
recursive-include tests *.py
recursive-include samples *.py *.md
299 changes: 299 additions & 0 deletions sdk/tables/azure-data-tables/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,299 @@
# Azure Data Tables client library for Python

Azure Data Tables is a NoSQL data storing service that can be accessed from anywhere in the world via authenticated calls using HTTP or HTTPS.
Tables scale as needed to support the amount of data inserted, and allow for the storing of data with non-complex accessing.
Tables scale as needed to support the amount of data inserted, and allow for the storing of data with non-complex accessing.
The Azure Data Tables client can be used to access Azure Storage or Cosmos accounts.

Common uses of Azure Data Tables include:

* Storing structured data in the form of tables
* Quickly querying data using a clustered index

[Source code](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) | [Package (PyPI)](https://pypi.org) | [API reference documentation](https://aka.ms/azsdk/python/tables/docs) | [Product documentation](https://docs.microsoft.com/azure/storage/) | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk)

## Getting started

### Prerequisites
* Python 2.7, or 3.5 or later is required to use this package.
* You must have an [Azure subscription](https://azure.microsoft.com/free/) and an
[Azure storage account](https://docs.microsoft.com/azure/storage/common/storage-account-overview) to use this package
or you must have a [Azure Cosmos Account](https://docs.microsoft.com/en-us/azure/cosmos-db/account-overview).

### Install the package
Install the Azure Data Tables client library for Python with [pip](https://pypi.org/project/pip/):

```bash
pip install --pre azure-data-tables
```

### Create a storage account
If you wish to create a new cosmos storage account, you can use the [Azure Cosmos DB](https://docs.microsoft.com/en-us/azure/cosmos-db/create-cosmosdb-resources-portal)
If you wish to create a new storage account, you can use the
[Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal),
[Azure PowerShell](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell),
or [Azure CLI](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli):

```bash
# Create a new resource group to hold the storage account -
# if using an existing resource group, skip this step
az group create --name MyResourceGroup --location westus2

# Create the storage account
az storage account create -n mystorageaccount -g MyResourceGroup
```

### Create the client
The Azure Data Tables client library for Python allows you to interact with two types of resources: the
account and tables, and entities. Interaction with these resources starts with an instance of a [client](#clients).
To create a client object, you will need the account's table service endpoint URL and a credential that allows
you to access the account:

```python
from azure.data.tables import TableServiceClient

service = TableServiceClient(account_url="https://<myaccount>.table.core.windows.net/", credential=credential)
```

#### Looking up the account URL
You can find the account's table service URL using the
[Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-account-overview#storage-account-endpoints),
[Azure PowerShell](https://docs.microsoft.com/powershell/module/az.storage/get-azstorageaccount),
or [Azure CLI](https://docs.microsoft.com/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-show):

```bash
# Get the table service URL for the account
az storage account show -n mystorageaccount -g MyResourceGroup --query "primaryEndpoints.table"
```

#### Types of credentials
The `credential` parameter may be provided in a number of different forms, depending on the type of
[authorization](https://docs.microsoft.com/azure/storage/common/storage-auth) you wish to use:
1. To use a [shared access signature (SAS) token](https://docs.microsoft.com/azure/storage/common/storage-sas-overview),
provide the token as a string. If your account URL includes the SAS token, omit the credential parameter.
You can generate a SAS token from the Azure Portal under "Shared access signature" or use one of the `generate_sas()`
functions to create a sas token for the account or table:

```python
from datetime import datetime, timedelta
from azure.data.tables import TableServiceClient, generate_account_sas, ResourceTypes, AccountSasPermissions

sas_token = generate_account_sas(
account_name="<account-name>",
account_key="<account-access-key>",
resource_types=ResourceTypes(service=True),
permission=AccountSasPermissions(read=True),
expiry=datetime.utcnow() + timedelta(hours=1)
)

table_service_client = TableServiceClient(account_url="https://<my_account_name>.table.core.windows.net", credential=sas_token)
```

2. To use an account [shared key](https://docs.microsoft.com/rest/api/storageservices/authenticate-with-shared-key/)
(aka account key or access key), provide the key as a string. This can be found in the Azure Portal under the "Access Keys"
section or by running the following Azure CLI command:

```az storage account keys list -g MyResourceGroup -n mystorageaccount```

Use the key as the credential parameter to authenticate the client:
```python
from azure.data.tables import TableServiceClient
service = TableServiceClient(account_url="https://<my_account_name>.table.core.windows.net", credential="<account_access_key>")
```

#### Creating the client from a connection string
Depending on your use case and authorization method, you may prefer to initialize a client instance with a
connection string instead of providing the account URL and credential separately. To do this, pass the
connection string to the client's `from_connection_string` class method:

```python
from azure.data.tables import TableServiceClient

connection_string = "DefaultEndpointsProtocol=https;AccountName=xxxx;AccountKey=xxxx;EndpointSuffix=core.windows.net"
service = TableServiceClient.from_connection_string(conn_str=connection_string)
```

The connection string to your account can be found in the Azure Portal under the "Access Keys" section or by running the following CLI command:

```bash
az storage account show-connection-string -g MyResourceGroup -n mystorageaccount
```

## Key concepts
The following components make up the Azure Data Tables Service:
* The account
* A table within the account, which contains a set of entities
* An entity within a table, as a dictionary

The Azure Data Tables client library for Python allows you to interact with each of these components through the
use of a dedicated client object.

### Clients
Two different clients are provided to to interact with the various components of the Table Service:
1. [TableServiceClient](https://aka.ms/azsdk/python/tables/docs) -
this client represents interaction with the Azure account itself, and allows you to acquire preconfigured
client instances to access the tables within. It provides operations to retrieve and configure the account
properties as well as query, create, and delete tables within the account. To perform operations on a specific table,
retrieve a client using the `get_table_client` method.
2. [TableClient](https://aka.ms/azsdk/python/tables/docs) -
this client represents interaction with a specific table (which need not exist yet). It provides operations to
create, delete, or update a table and includes operations to query, get, and upsert entities
within it.

### Entities
* **Create** - Adds an entity to the table.
* **Delete** - Deletes an entity from the table.
* **Update** - Updates an entities information by either merging or replacing the existing entity.
* **Query** - Queries existing entities in a table based off of the QueryOptions (OData).
* **Get** - Gets a specific entity from a table by partition and row key.
* **Upsert** - Merges or replaces an entity in a table, or if the entity does not exist, inserts the entity.

## Examples

The following sections provide several code snippets covering some of the most common Table tasks, including:

* [Creating a table](#creating-a-table "Creating a table")
* [Creating entities](#creating-entities "Creating entities")
* [Querying entities](#querying-entities "Querying entities")


### Creating a table
Create a table in your account

```python
from azure.data.tables import TableServiceClient

table_service_client = TableServiceClient.from_connection_string(conn_str="<connection_string>")
table_service_client.create_table(table_name="myTable")
```

### Creating entities
Create entities in the table

```python
from azure.data.tables import TableClient

my_entity = {'PartitionKey':'part','RowKey':'row'}

table_client = TableClient.from_connection_string(conn_str="<connection_string>", table_name="myTable")
entity = table_client.create_entity(entity=my_entity)
```

### Querying entities
Querying entities in the table

```python
from azure.data.tables import TableClient

my_filter = "text eq Marker"

table_client = TableClient.from_connection_string(conn_str="<connection_string>", table_name="mytable")
entity = table_client.query_entities(filter=my_filter)
```

## Optional Configuration

Optional keyword arguments can be passed in at the client and per-operation level. The azure-core [reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-core/latest/azure.core.html) describes available configurations for retries, logging, transport protocols, and more.


### Retry Policy configuration

Use the following keyword arguments when instantiating a client to configure the retry policy:

* __retry_total__ (int): Total number of retries to allow. Takes precedence over other counts.
Pass in `retry_total=0` if you do not want to retry on requests. Defaults to 10.
* __retry_connect__ (int): How many connection-related errors to retry on. Defaults to 3.
* __retry_read__ (int): How many times to retry on read errors. Defaults to 3.
* __retry_status__ (int): How many times to retry on bad status codes. Defaults to 3.
* __retry_to_secondary__ (bool): Whether the request should be retried to secondary, if able.
This should only be enabled of RA-GRS accounts are used and potentially stale data can be handled.
Defaults to `False`.

### Other client / per-operation configuration

Other optional configuration keyword arguments that can be specified on the client or per-operation.

**Client keyword arguments:**

* __connection_timeout__ (int): Optionally sets the connect and read timeout value, in seconds.
* __transport__ (Any): User-provided transport to send the HTTP request.

**Per-operation keyword arguments:**

* __raw_response_hook__ (callable): The given callback uses the response returned from the service.
* __raw_request_hook__ (callable): The given callback uses the request before being sent to service.
* __client_request_id__ (str): Optional user specified identification of the request.
* __user_agent__ (str): Appends the custom value to the user-agent header to be sent with the request.
* __logging_enable__ (bool): Enables logging at the DEBUG level. Defaults to False. Can also be passed in at
the client level to enable it for all requests.
* __headers__ (dict): Pass in custom headers as key, value pairs. E.g. `headers={'CustomValue': value}`


## Troubleshooting
### General
Azure Data Tables clients raise exceptions defined in [Azure Core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/README.md).
All Table service operations will throw a `HttpResponseError` on failure with helpful [error codes](https://docs.microsoft.com/en-us/rest/api/storageservices/table-service-error-codes).

### Logging
This library uses the standard
[logging](https://docs.python.org/3/library/logging.html) library for logging.
Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO
level.

Detailed DEBUG level logging, including request/response bodies and unredacted
headers, can be enabled on a client with the `logging_enable` argument:
```python
import sys
import logging
from azure.data.tables import TableServiceClient

# Create a logger for the 'azure.data.tables' SDK
logger = logging.getLogger('azure.data.tables')
logger.setLevel(logging.DEBUG)

# Configure a console output
handler = logging.StreamHandler(stream=sys.stdout)
logger.addHandler(handler)

# This client will log detailed information about its HTTP sessions, at DEBUG level
service_client = TableServiceClient.from_connection_string("your_connection_string", logging_enable=True)
```

Similarly, `logging_enable` can enable detailed logging for a single operation,
even when it isn't enabled for the client:
```py
service_client.get_service_stats(logging_enable=True)
```

## Next steps

Get started with our [Table samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk).

Several Azure Data Tables Python SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered while working with Tables:

* [table_samples_authentication.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article:
* From a connection string
* From a shared access key
* From a shared access signature token
* [table_samples_service.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article:
* Get and set service properties
* List tables in a account
* Create and delete a table from the service
* Get the TableClient
* [table_samples_client.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk) - Examples found in this article:
* Client creation
* Create a table
* Create and Delete entities
* Query entities
* Update entities
* Upsert entities

### Additional documentation
For more extensive documentation on Azure Data Tables, see the [Azure Data Tables documentation](https://docs.microsoft.com/azure/storage/tables/) on docs.microsoft.com.

## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
1 change: 1 addition & 0 deletions sdk/tables/azure-data-tables/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
1 change: 1 addition & 0 deletions sdk/tables/azure-data-tables/azure/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
Loading