Skip to content

Commit 8c68a3f

Browse files
authored
Suppress grpc warnings (#1504)
## Changes New `grpcio` lib (which is a dependency of `databricks-connect` package) produces warnings when you run any code. I've notified `databricks-connect` developers to solve it on their side, but in the meantime we can suppress warnings with the env vars Fixes #1478
1 parent ab65627 commit 8c68a3f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packages/databricks-vscode/resources/python/00-databricks-init.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,10 @@ def make_matplotlib_inline():
492492
import sys
493493

494494
print(sys.modules[__name__])
495+
496+
# Suppress grpc warnings coming from databricks-connect with newer version of grpcio lib
497+
os.environ["GRPC_VERBOSITY"] = "NONE"
498+
495499
if not load_env_from_leaf(os.getcwd()):
496500
sys.exit(1)
497501
cfg = LocalDatabricksNotebookConfig()

packages/databricks-vscode/resources/python/dbconnect-bootstrap.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ def load_env_file_from_cwd(path: str):
3232
logging.error(f"Failed to get current directory: {e}")
3333
cur_dir = os.getcwd()
3434

35+
# Suppress grpc warnings coming from databricks-connect with newer version of grpcio lib
36+
os.environ["GRPC_VERBOSITY"] = "NONE"
37+
3538
root_dir = os.getcwd()
3639
load_env_file_from_cwd(root_dir)
3740

0 commit comments

Comments
 (0)