diff --git a/sdk/purview/azure-purview-catalog/CHANGELOG.md b/sdk/purview/azure-purview-catalog/CHANGELOG.md index 7d4529c30aa6..637bfc8b5e6e 100644 --- a/sdk/purview/azure-purview-catalog/CHANGELOG.md +++ b/sdk/purview/azure-purview-catalog/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +- Fix `delete_by_guids` to get rid of bad request error #22487 + ### Other Changes ## 1.0.0b2 (2021-09-29) diff --git a/sdk/purview/azure-purview-catalog/azure/purview/catalog/aio/operations/_operations.py b/sdk/purview/azure-purview-catalog/azure/purview/catalog/aio/operations/_operations.py index caf1eefed102..b13fd91c3e85 100644 --- a/sdk/purview/azure-purview-catalog/azure/purview/catalog/aio/operations/_operations.py +++ b/sdk/purview/azure-purview-catalog/azure/purview/catalog/aio/operations/_operations.py @@ -378,7 +378,7 @@ async def list_by_guids( ) -> Any: """List entities in bulk identified by its GUIDs. - :keyword guids: An array of GUIDs of entities to create. + :keyword guids: An array of GUIDs of entities to list. :paramtype guids: list[str] :keyword min_ext_info: Whether to return minimal information for referred entities. :paramtype min_ext_info: bool @@ -9852,7 +9852,7 @@ async def query( "filter": {}, # Optional. The filter for the search. See examples for the usage of supported filters. "keywords": "str", # Optional. The keywords applied to all searchable fields. "limit": 0, # Optional. The limit of the number of the search result. default value is 50; maximum value is 1000. - "offset": 0, # Optional. The offset. The default value is 0. + "offset": 0, # Optional. The offset. The default value is 0. The maximum value is 100000. "taxonomySetting": { "assetTypes": [ "str" # Optional. @@ -10129,8 +10129,8 @@ async def browse( # JSON input template you can fill out and use as your body input. browse_request = { "entityType": "str", # Optional. The entity type to browse as the root level entry point. - "limit": 0, # Optional. The number of browse items we hope to return. - "offset": 0, # Optional. The offset. The default value is 0. + "limit": 0, # Optional. The number of browse items we hope to return. The maximum value is 10000. + "offset": 0, # Optional. The offset. The default value is 0. The maximum value is 100000. "path": "str" # Optional. The path to browse the next level child entities. } diff --git a/sdk/purview/azure-purview-catalog/azure/purview/catalog/operations/_operations.py b/sdk/purview/azure-purview-catalog/azure/purview/catalog/operations/_operations.py index 2ff0da1724c6..5bc72b694128 100644 --- a/sdk/purview/azure-purview-catalog/azure/purview/catalog/operations/_operations.py +++ b/sdk/purview/azure-purview-catalog/azure/purview/catalog/operations/_operations.py @@ -70,7 +70,7 @@ def build_entity_list_by_guids_request( # Construct parameters query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['guids'] = [_SERIALIZER.query("guids", q, 'str') if q is not None else '' for q in guids] + query_parameters['guid'] = [_SERIALIZER.query("guids", q, 'str') if q is not None else '' for q in guids] if min_ext_info is not None: query_parameters['minExtInfo'] = _SERIALIZER.query("min_ext_info", min_ext_info, 'bool') if ignore_relationships is not None: @@ -127,7 +127,7 @@ def build_entity_delete_by_guids_request( # Construct parameters query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['guids'] = [_SERIALIZER.query("guids", q, 'str') if q is not None else '' for q in guids] + query_parameters['guid'] = [_SERIALIZER.query("guids", q, 'str') if q is not None else '' for q in guids] # Construct headers header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] @@ -3197,7 +3197,7 @@ def list_by_guids( # type: (...) -> Any """List entities in bulk identified by its GUIDs. - :keyword guids: An array of GUIDs of entities to create. + :keyword guids: An array of GUIDs of entities to list. :paramtype guids: list[str] :keyword min_ext_info: Whether to return minimal information for referred entities. :paramtype min_ext_info: bool @@ -12721,7 +12721,7 @@ def query( "filter": {}, # Optional. The filter for the search. See examples for the usage of supported filters. "keywords": "str", # Optional. The keywords applied to all searchable fields. "limit": 0, # Optional. The limit of the number of the search result. default value is 50; maximum value is 1000. - "offset": 0, # Optional. The offset. The default value is 0. + "offset": 0, # Optional. The offset. The default value is 0. The maximum value is 100000. "taxonomySetting": { "assetTypes": [ "str" # Optional. @@ -13000,8 +13000,8 @@ def browse( # JSON input template you can fill out and use as your body input. browse_request = { "entityType": "str", # Optional. The entity type to browse as the root level entry point. - "limit": 0, # Optional. The number of browse items we hope to return. - "offset": 0, # Optional. The offset. The default value is 0. + "limit": 0, # Optional. The number of browse items we hope to return. The maximum value is 10000. + "offset": 0, # Optional. The offset. The default value is 0. The maximum value is 100000. "path": "str" # Optional. The path to browse the next level child entities. } diff --git a/sdk/purview/azure-purview-catalog/swagger/README.md b/sdk/purview/azure-purview-catalog/swagger/README.md index 9d836a8f7dce..62adc8c504aa 100644 --- a/sdk/purview/azure-purview-catalog/swagger/README.md +++ b/sdk/purview/azure-purview-catalog/swagger/README.md @@ -20,7 +20,7 @@ autorest ### Settings ```yaml -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/purviewcatalog.json +input-file: https://github.com/Azure/azure-rest-api-specs/blob/dc439efcfc15448824877603f66fc1578d1c71c5/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/purviewcatalog.json output-folder: ../azure/purview/catalog namespace: azure.purview.catalog package-name: azure-purview-catalog diff --git a/sdk/purview/azure-purview-catalog/tests/test_smoke.py b/sdk/purview/azure-purview-catalog/tests/test_smoke.py index f5e5fc71a244..6f3565e7466e 100644 --- a/sdk/purview/azure-purview-catalog/tests/test_smoke.py +++ b/sdk/purview/azure-purview-catalog/tests/test_smoke.py @@ -5,6 +5,8 @@ # license information. # -------------------------------------------------------------------------- from testcase import PurviewCatalogTest, PurviewCatalogPowerShellPreparer +from urllib.parse import urlparse +from azure.purview.catalog.operations._operations import build_entity_delete_by_guids_request, build_entity_list_by_guids_request class PurviewCatalogSmokeTest(PurviewCatalogTest): @@ -15,3 +17,11 @@ def test_basic_smoke_test(self, purviewcatalog_endpoint): response = client.types.get_all_type_definitions() assert set(response.keys()) == set(['enumDefs', 'structDefs', 'classificationDefs', 'entityDefs', 'relationshipDefs']) + + def test_delete_by_guids(self): + request = build_entity_delete_by_guids_request(guids=["foo", "bar"]) + assert urlparse(request.url).query == "guid=foo&guid=bar" + + def test_list_by_guids(self): + request = build_entity_list_by_guids_request(guids=["foo", "bar"]) + assert "guid=foo&guid=bar" in urlparse(request.url).query