Skip to content

Commit

Permalink
commented unused lines
Browse files Browse the repository at this point in the history
  • Loading branch information
vighnesh-wednesday committed Dec 14, 2023
1 parent 61392e5 commit 73da6a9
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions app/connect_databricks.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import os
from databricks.connect import DatabricksSession
from databricks.sdk import WorkspaceClient
# from databricks.connect import DatabricksSession
# from databricks.sdk import WorkspaceClient


def init_databricks():
os.system("cp /dbfs/mnt/config/databricks-connect.txt ~/.databrickscfg")
# def init_databricks():
# os.system("cp /dbfs/mnt/config/databricks-connect.txt ~/.databrickscfg")

spark = DatabricksSession.builder.getOrCreate()
# spark = DatabricksSession.builder.getOrCreate()

dbutils = WorkspaceClient().dbutils
# dbutils = WorkspaceClient().dbutils

return spark, dbutils
# return spark, dbutils

def get_param_value(dbutils, param_key):
return dbutils.widgets.get(param_key)
Expand All @@ -35,11 +35,11 @@ def create_mount(dbutils, container_name, mount_path):
print(f"{mount_path} Already mounted")


def unmount(dbutils, mount_path):
try:
dbutils.fs.unmount(mount_path)
print("Unmount Successful")
except FileNotFoundError:
print(f"Error: Path not found - {mount_path}")
except Exception as e: # pylint: disable=W0718
print(f"Error: {e}")
# def unmount(dbutils, mount_path):
# try:
# dbutils.fs.unmount(mount_path)
# print("Unmount Successful")
# except FileNotFoundError:
# print(f"Error: Path not found - {mount_path}")
# except Exception as e: # pylint: disable=W0718
# print(f"Error: {e}")

0 comments on commit 73da6a9

Please sign in to comment.