databricks-sdk-py icon indicating copy to clipboard operation
databricks-sdk-py copied to clipboard

[ISSUE] Error with w.shares.share_permissions function / PermissionsList class not defined

Open metalcore-labs opened this issue 1 year ago • 1 comments

Description An error is triggered when using the shares.share_permissions() function.

NameError: name 'PermissionsList' is not defined.

Reproduction Call the shares.share_permissions() function against any named share.

Expected behavior The function returns a list of permissions to the share including recipient name and access level (SELECT).

Is it a regression? ??

Additional context This is fixed by importing the PermissionsList class in sharing.py. from databricks.sdk.service.catalog import PermissionsList

metalcore-labs avatar Jun 18 '24 14:06 metalcore-labs

:+1: we just ran into this as well!

You can temporarily work around this by patching the modules at runtime (🤮):

import databricks.sdk.service.sharing
from databricks.sdk.service.catalog import PermissionsList
databricks.sdk.service.sharing.__dict__['PermissionsList'] = PermissionsList

Korijn avatar Sep 11 '24 11:09 Korijn