diff --git a/databricks/sdk/runtime/__init__.py b/databricks/sdk/runtime/__init__.py index e83c9d65c..e4a3bfd87 100644 --- a/databricks/sdk/runtime/__init__.py +++ b/databricks/sdk/runtime/__init__.py @@ -6,7 +6,8 @@ # available to be imported from databricks.sdk.runtime.globals. This import can be used # in Python modules so users can access these objects from Files more easily. dbruntime_objects = [ - "display", "displayHTML", "dbutils", "table", "sql", "udf", "getArgument", "sc", "sqlContext", "spark" + "display", "displayHTML", "dbutils", "table", "sql", "udf", "getArgument", "sc", "sqlContext", "spark", + "init_runtime_native_auth" ] RuntimeAuth = Tuple[str, Callable[[], Dict[str, str]]] @@ -23,6 +24,8 @@ def init_runtime_native_auth() -> RuntimeAuth: userNamespaceGlobals = UserNamespaceInitializer.getOrCreate().get_namespace_globals() _globals = globals() for var in dbruntime_objects: + if var not in userNamespaceGlobals: + continue _globals[var] = userNamespaceGlobals[var] is_local_implementation = False except ImportError: