Skip to content

Commit 19d3344

Browse files
committed
debugging deletion
1 parent 2a93cfa commit 19d3344

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

src/webapp/database.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,18 @@ class AccountHistoryTable(Base):
243243
association_table = Table(
244244
"file_batch_association_table",
245245
Base.metadata,
246-
Column("file_val", Uuid(as_uuid=True), ForeignKey("file.id", ondelete="CASCADE"), primary_key=True),
247-
Column("batch_val", Uuid(as_uuid=True), ForeignKey("batch.id", ondelete="CASCADE"), primary_key=True),
246+
Column(
247+
"file_val",
248+
Uuid(as_uuid=True),
249+
ForeignKey("file.id", ondelete="CASCADE"),
250+
primary_key=True,
251+
),
252+
Column(
253+
"batch_val",
254+
Uuid(as_uuid=True),
255+
ForeignKey("batch.id", ondelete="CASCADE"),
256+
primary_key=True,
257+
),
248258
)
249259

250260

src/webapp/gcsutil.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ def generate_download_signed_url(self, bucket_name: str, blob_name: str) -> str:
114114
def delete_bucket(self, bucket_name: str) -> None:
115115
storage_client = storage.Client()
116116
# Delete the GCS bucket. Force=True handles non-empty buckets.
117+
print("[debugging_crystal]: in delete_bucket()1")
118+
117119
bucket = storage_client.get_bucket(bucket_name)
120+
print("[debugging_crystal]: in delete_bucket()2:" + str(bucket))
118121
bucket.delete(force=True)
122+
print("[debugging_crystal]: in delete_bucket()3")
119123

120124
def create_bucket(self, bucket_name: str) -> None:
121125
"""

src/webapp/routers/institutions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,12 @@ def delete_inst(
270270
)
271271
local_session.get().commit()
272272
# Delete GCS bucket
273+
print("[debugging_crystal]: deleting bucket")
273274
bucket_name = get_external_bucket_name(inst_id)
275+
print("[debugging_crystal]: deleting bucket" + bucket_name)
274276
try:
275277
storage_control.delete_bucket(bucket_name)
276-
except ValueError as e:
278+
except Exception as e:
277279
raise HTTPException(
278280
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
279281
detail="Storage bucket deletion failed:" + str(e),

src/webapp/routers/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def trigger_inference_run(
556556
except Exception as e:
557557
raise HTTPException(
558558
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
559-
detail="Databricks run_pdp_inference error. "+str(e),
559+
detail="Databricks run_pdp_inference error. " + str(e),
560560
)
561561
triggered_timestamp = datetime.now()
562562
job = JobTable(

0 commit comments

Comments
 (0)