-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding helper functions for DB operations #24
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24 +/- ##
===========================================
- Coverage 76.92% 60.71% -16.21%
===========================================
Files 1 2 +1
Lines 39 56 +17
===========================================
+ Hits 30 34 +4
- Misses 9 22 +13 ☔ View full report in Codecov by Sentry. |
src/db_ops/spark_db_utils.py
Outdated
try: | ||
spark.sql(f"CREATE DATABASE IF NOT EXISTS {namespace}") | ||
print(f"Namespace {namespace} is ready to use.") | ||
except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just throw the exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 make sense to just throw exception.
src/db_ops/spark_db_utils.py
Outdated
try: | ||
spark.sql(f"DROP TABLE IF EXISTS {spark_catalog}") | ||
print(f"Table {spark_catalog} removed.") | ||
except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.