-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
in the function: _verify_workspace_client
we are retrieving the product_info from the config, and checking if product_info[0] != "dqx", and then if its value is not dqx, then setting _product_info as default dqx.
There may be cases, where the user have not set the product in their config, and it would throw the
TypeError: 'NoneType' object is not subscriptable exception
The user might initialise the WorkspaceClient like this:
ws = WorkspaceClient(
config=Config(
host=os.getenv("DATABRICKS_HOST"),
token=os.getenv("DATABRICKS_TOKEN"),
),
)
Expected Behavior
The function should check product_info for None, and if None, then set it as default value
Steps To Reproduce
- set the WorkspaceClient like this
ws = WorkspaceClient(
config=Config(
host=os.getenv("DATABRICKS_HOST"),
token=os.getenv("DATABRICKS_TOKEN"),
),
)
Cloud
AWS
Operating System
macOS
Relevant log output
File "/databricks/python/lib/python3.12/site-packages/databricks/labs/dqx/engine.py", line 473, in __init__
super().__init__(workspace_client)
File "/databricks/python/lib/python3.12/site-packages/databricks/labs/dqx/base.py", line 14, in __init__
self._workspace_client = self._verify_workspace_client(workspace_client)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/databricks/python/lib/python3.12/site-packages/databricks/labs/dqx/base.py", line 33, in _verify_workspace_client
if product_info[0] != "dqx":
~~~~~~~~~~~~^^^
TypeError: 'NoneType' object is not subscriptableMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working