databricks / databricks-sdk-py

Databricks SDK for Python (Beta)
https://databricks-sdk-py.readthedocs.io/
Apache License 2.0
352 stars 117 forks source link

[ISSUE] list_network_connectivity_configurations always returns an empty array #687

Open pdruzhinin opened 3 months ago

pdruzhinin commented 3 months ago

Description NetworkConnectivityAPI.list_network_connectivity_configurations() always returns an empty array. This seems to be happening because the API is not returning a JSON object with items and next_page_token despite what the documentation says. Instead, it's returning an array of network connectivity configurations.

Reproduction

account_client = AccountClient(
        host="https://accounts.azuredatabricks.net",
    )
ncc_list = list(
    account_client.network_connectivity.list_network_connectivity_configurations()
)

print(ncc_list)

Expected behavior List of network connectivity configurations is returned.

Is it a regression? Not sure.

Debug Logs Debug logs indicate that a correct response is returned from the API, but the SDK is not parsing it properly.

Other Information

Additional context I changed the code locally from

            if 'items' in json:
                for v in json['items']:
                    yield NetworkConnectivityConfiguration.from_dict(v)

to

            if json:
                for v in json:
                    yield NetworkConnectivityConfiguration.from_dict(v)

and it's working as expected. However I'm not sure if a response with items and next_page_token is returned starting from some specific number of NCCs, or if the API is going to be updated to match the SDK and documentation.