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

added create_table_if_not_exists method to table service client #13385

Merged
merged 4 commits into from
Aug 31, 2020

Conversation

seankane-msft
Copy link
Member

This adds a create_table_if_not_exists method to the TableServiceClient. If the table exists, the error is caught and a TableClient is caught. If the table does not exist it is created and a TableClient for the new table is returned.

Asking for review on the implementation and whether it should be TableServiceClient or TableClient method.

…ntially create table wrapped in try/except block
@@ -156,6 +156,30 @@ def create_table(
table.create_table(**kwargs)
return table

@distributed_trace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like having it on the TableServiceClient, it doesn't make as much sense to me having it on TableClient since that's what you're trying to create

@seankane-msft seankane-msft merged commit 43d7ebf into Azure:master Aug 31, 2020
@seankane-msft seankane-msft deleted the create-if-not-exists branch August 31, 2020 20:59
@seankane-msft seankane-msft linked an issue Aug 31, 2020 that may be closed by this pull request
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Sep 1, 2020
…into add_redacted_text

* 'master' of https://github.com/Azure/azure-sdk-for-python:
  [text analytics] add bing_id property to LinkedEntity class (Azure#13446)
  fix typing for paging methods (Azure#13410)
  [text analytics] add domain_filter param (Azure#13451)
  fix issue Azure#11658 for is_valid_resource_id (Azure#11709)
  added create_table_if_not_exists method to table service client (Azure#13385)
  [ServiceBus] Test and failure improvements (Azure#13345)
  Proper encoding and decoding of source URLs - Fixes special characters in source URL issue (Azure#13275)
  Switch retry (Azure#13264)
  [ServiceBus] ServiceBusClient close spawned children (Azure#13077)
  fixing version issue by not overwriting the version with the semantic… (Azure#13411)
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Sep 1, 2020
…into expose_parse_vault_id

* 'master' of https://github.com/Azure/azure-sdk-for-python: (37 commits)
  [text analytics] add versionadded sphinx documentation (Azure#13450)
  [text analytics] add bing_id property to LinkedEntity class (Azure#13446)
  fix typing for paging methods (Azure#13410)
  [text analytics] add domain_filter param (Azure#13451)
  fix issue Azure#11658 for is_valid_resource_id (Azure#11709)
  added create_table_if_not_exists method to table service client (Azure#13385)
  [ServiceBus] Test and failure improvements (Azure#13345)
  Proper encoding and decoding of source URLs - Fixes special characters in source URL issue (Azure#13275)
  Switch retry (Azure#13264)
  [ServiceBus] ServiceBusClient close spawned children (Azure#13077)
  fixing version issue by not overwriting the version with the semantic… (Azure#13411)
  clean up reference and tests (Azure#13412)
  Consistent returns (Azure#13245)
  [text analytics] return None for offset and length for v3.0 (Azure#13382)
  edit all authentication files and add a test (Azure#13355)
  Add managed_identity_client_id argument to DefaultAzureCredential (Azure#13218)
  [text analytics] add string-index-type support (Azure#13378)
  [text analytics] fix error response if pii entities is called from v3.0 client (Azure#13383)
  Send spec (Azure#13143)
  Anomaly Detector 3.0.0b2 release (Azure#13351)
  ...
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Sep 2, 2020
…into link_om_sample

* 'master' of https://github.com/Azure/azure-sdk-for-python: (23 commits)
  Int32 serialization (Azure#13452)
  add output to opinion mining sample (Azure#13494)
  Add Document w/ Eng Sys Checks (Azure#13492)
  update version (Azure#13495)
  Remove resources post test (Azure#13379)
  bing_id -> bing_entity_search_api_id (Azure#13491)
  [EventGrid] Read me + improve docstrings (Azure#13484)
  Build AuthenticationRecords from ADFS identity tokens (Azure#13341)
  Support Subject Name/Issuer authentication (Azure#13350)
  Add KeyVaultAccessControlClient for data plane RBAC (Azure#13372)
  [text analytics] Add redacted_text (Azure#13449)
  add python sdk sample (Azure#13338)
  [text analytics] add versionadded sphinx documentation (Azure#13450)
  [text analytics] add bing_id property to LinkedEntity class (Azure#13446)
  fix typing for paging methods (Azure#13410)
  [text analytics] add domain_filter param (Azure#13451)
  fix issue Azure#11658 for is_valid_resource_id (Azure#11709)
  added create_table_if_not_exists method to table service client (Azure#13385)
  [ServiceBus] Test and failure improvements (Azure#13345)
  Proper encoding and decoding of source URLs - Fixes special characters in source URL issue (Azure#13275)
  ...
rakshith91 pushed a commit to rakshith91/azure-sdk-for-python that referenced this pull request Sep 4, 2020
…e#13385)

* added create_table_if_not_exists method to table service client, eseentially create table wrapped in try/except block

* lint fix

* fixing up issy's comments

* table_name not name, fixed test bug
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this pull request Apr 1, 2021
Merge Dev-containerservice-microsoft.containerservice-2021-03-01 API to master  (Azure#13737)

* Adds base for updating Microsoft.ContainerService from version stable/2021-02-01 to version 2021-03-01

* Updates readme

* Updates API version in new specs and examples

* fix the top swagger offenses caused by privateLinkResources, enableCSIProxy and OSDiskSize range (Azure#13349)

Co-authored-by: Charlie Li <charlili@microsoft.com>

* Add enableFIPS property to 2021-03-01 API in dev 2021-03-01 branch (Azure#13359)

* fix the top swagger offenses caused by privateLinkResources, enableCSIProxy and OSDiskSize range

* Add enableFIPS property to the 2021-03-01 API

* Add enableFIPS property to the 2021-03-01 API

Co-authored-by: Charlie Li <charlili@microsoft.com>

* adding node-image upgrade channel enum (Azure#13375)

Co-authored-by: Charlie McBride <Charlie.McBride@microsoft.com>

* Add httpProxyConfig specs to 2021-03-01 API - dev (Azure#13410)

* Add httpProxyConfig specs to 2021-03-01 API - dev

* Fix prettier

* aks: add `bindingSelector` to managed cluster pod identity profile (Azure#13399)

* AKS runCommand new feature  (Azure#13420)

* runCommand target to 03-01

* fix api-version in examples

* Add property disableLocalAccounts to 2021-03-01 API version (Azure#13385)

* Add property disableLocalAccounts

* Fix indentation

* Add OSSKU and GPUInstanceProfile to containerservice/microsoft.container API 2021-03-01 (Azure#13532)

* Add OSSKU and GPUInstanceProfile

* Add sample for OSSKU and GPUInstanceProfile

* Fix custom words

* Reference sample files

* update custom-words

* Update readme for sdks  (Azure#13515)

* update readme for sdks

* update readme for sdks

Co-authored-by: Charlie Li <charlili@microsoft.com>

* Add example to create agent pool with FIPS enabled (Azure#13557)

* add example to create agent pool with FIPS enabled

* change a property name in the example file

Co-authored-by: Charlie Li <charlili@microsoft.com>

* Added extended location parameter to managed cluster which will target all agent pools to that extended location. (Azure#13560)

* Add data model for get OS options. (Azure#13619)

* Add data model for get OS options.

* Add default resource name in API path.

* Fix container service tags. (Azure#13739)

Co-authored-by: Tongyao Si <tosi@microsoft.com>
Co-authored-by: Charlie Li <charlili@microsoft.com>
Co-authored-by: Charlie McBride <33269602+charliedmcb@users.noreply.github.com>
Co-authored-by: Charlie McBride <Charlie.McBride@microsoft.com>
Co-authored-by: Bo Wang <61758179+bowang-666@users.noreply.github.com>
Co-authored-by: hbc <bcxxxxxx@gmail.com>
Co-authored-by: Haitao Chen <haitch@users.noreply.github.com>
Co-authored-by: Tony Xu <tonyxu@microsoft.com>
Co-authored-by: Mirza Sikander <mirsik@microsoft.com>
Co-authored-by: Jun Sun <33297523+JunSun17@users.noreply.github.com>
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this pull request Apr 1, 2021
Merge Dev-containerservice-microsoft.containerservice-2021-03-01 API to master  (Azure#13737)

* Adds base for updating Microsoft.ContainerService from version stable/2021-02-01 to version 2021-03-01

* Updates readme

* Updates API version in new specs and examples

* fix the top swagger offenses caused by privateLinkResources, enableCSIProxy and OSDiskSize range (Azure#13349)

Co-authored-by: Charlie Li <charlili@microsoft.com>

* Add enableFIPS property to 2021-03-01 API in dev 2021-03-01 branch (Azure#13359)

* fix the top swagger offenses caused by privateLinkResources, enableCSIProxy and OSDiskSize range

* Add enableFIPS property to the 2021-03-01 API

* Add enableFIPS property to the 2021-03-01 API

Co-authored-by: Charlie Li <charlili@microsoft.com>

* adding node-image upgrade channel enum (Azure#13375)

Co-authored-by: Charlie McBride <Charlie.McBride@microsoft.com>

* Add httpProxyConfig specs to 2021-03-01 API - dev (Azure#13410)

* Add httpProxyConfig specs to 2021-03-01 API - dev

* Fix prettier

* aks: add `bindingSelector` to managed cluster pod identity profile (Azure#13399)

* AKS runCommand new feature  (Azure#13420)

* runCommand target to 03-01

* fix api-version in examples

* Add property disableLocalAccounts to 2021-03-01 API version (Azure#13385)

* Add property disableLocalAccounts

* Fix indentation

* Add OSSKU and GPUInstanceProfile to containerservice/microsoft.container API 2021-03-01 (Azure#13532)

* Add OSSKU and GPUInstanceProfile

* Add sample for OSSKU and GPUInstanceProfile

* Fix custom words

* Reference sample files

* update custom-words

* Update readme for sdks  (Azure#13515)

* update readme for sdks

* update readme for sdks

Co-authored-by: Charlie Li <charlili@microsoft.com>

* Add example to create agent pool with FIPS enabled (Azure#13557)

* add example to create agent pool with FIPS enabled

* change a property name in the example file

Co-authored-by: Charlie Li <charlili@microsoft.com>

* Added extended location parameter to managed cluster which will target all agent pools to that extended location. (Azure#13560)

* Add data model for get OS options. (Azure#13619)

* Add data model for get OS options.

* Add default resource name in API path.

* Fix container service tags. (Azure#13739)

Co-authored-by: Tongyao Si <tosi@microsoft.com>
Co-authored-by: Charlie Li <charlili@microsoft.com>
Co-authored-by: Charlie McBride <33269602+charliedmcb@users.noreply.github.com>
Co-authored-by: Charlie McBride <Charlie.McBride@microsoft.com>
Co-authored-by: Bo Wang <61758179+bowang-666@users.noreply.github.com>
Co-authored-by: hbc <bcxxxxxx@gmail.com>
Co-authored-by: Haitao Chen <haitch@users.noreply.github.com>
Co-authored-by: Tony Xu <tonyxu@microsoft.com>
Co-authored-by: Mirza Sikander <mirsik@microsoft.com>
Co-authored-by: Jun Sun <33297523+JunSun17@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tables] revisit whether Python should have a CreateIfNotExists
2 participants