Skip to content

Commit 3d22a18

Browse files
ItsMeAbbycopybara-github
authored andcommitted
fix: GCS Bucket subdirectory not being creating while using ReasoningEngine create method
COPYBARA_INTEGRATE_REVIEW=#3651 from ItsMeAbby:patch-1 dba25ee PiperOrigin-RevId: 628104988
1 parent 86b6cd3 commit 3d22a18

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vertexai/reasoning_engines/_reasoning_engines.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,13 @@ def _prepare(
374374
gcs_bucket = storage_client.create_bucket(new_bucket, location=location)
375375
_LOGGER.info(f"Creating bucket {staging_bucket} in {location=}")
376376

377-
blob = gcs_bucket.blob(os.path.join(gcs_dir_name, _BLOB_FILENAME))
377+
blob = gcs_bucket.blob(f"{gcs_dir_name}/{_BLOB_FILENAME}")
378378
with blob.open("wb") as f:
379379
cloudpickle.dump(reasoning_engine, f)
380380
dir_name = f"gs://{staging_bucket}/{gcs_dir_name}"
381381
_LOGGER.info(f"Writing to {dir_name}/{_BLOB_FILENAME}")
382382

383-
blob = gcs_bucket.blob(os.path.join(gcs_dir_name, _REQUIREMENTS_FILE))
383+
blob = gcs_bucket.blob(f"{gcs_dir_name}/{_REQUIREMENTS_FILE}")
384384
if requirements:
385385
blob.upload_from_string("\n".join(requirements))
386386
_LOGGER.info(f"Writing to {dir_name}/{_REQUIREMENTS_FILE}")
@@ -391,6 +391,6 @@ def _prepare(
391391
for file in extra_packages:
392392
tar.add(file)
393393
tar_fileobj.seek(0)
394-
blob = gcs_bucket.blob(os.path.join(gcs_dir_name, _EXTRA_PACKAGES_FILE))
394+
blob = gcs_bucket.blob(f"{gcs_dir_name}/{_EXTRA_PACKAGES_FILE}")
395395
blob.upload_from_string(tar_fileobj.read())
396396
_LOGGER.info(f"Writing to {dir_name}/{_EXTRA_PACKAGES_FILE}")

0 commit comments

Comments
 (0)