Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Update databases_helper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SireInsectus committed Oct 11, 2022
1 parent 1aa8ea3 commit 655292e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dbacademy_helper/databases_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ def __create_database_for(self, username: str, drop_existing: bool, post_create:
# The database already exists.

if drop_existing: dbgems.spark.sql(f"DROP DATABASE IF EXISTS {db_name} CASCADE;")
else: return f"Skipping existing schema \"{db_name}\" for {username}"
else: return print(f"Skipping existing schema \"{db_name}\" for {username}")

dbgems.sql(f"CREATE DATABASE IF NOT EXISTS {db_name} LOCATION '{db_path}';")

if post_create:
# Call the post-create init function if defined
post_create(db_name)

return f"Created schema \"{db_name}\" for {username}, dropped existing: {drop_existing}"
return print(f"Created schema \"{db_name}\" for {username}, dropped existing: {drop_existing}")

def configure_permissions(self, notebook_name, spark_version="10.4.x-scala2.12"):

Expand Down

0 comments on commit 655292e

Please sign in to comment.