Open
Conversation
saurabhmathurgoogle
approved these changes
Jan 6, 2026
| upload_status = prepare_gcs_bucket(gcs_bucket, file_path, filename) | ||
| upload_status = prepare_gcs_bucket(gcs_bucket, folder_name, file_path, filename) | ||
| if not upload_status: | ||
| logger.error(f"Failed to prepare GCS bucket '{gcs_bucket}' for file '{filename}'. Skipping import.") |
Contributor
There was a problem hiding this comment.
lets log folder_name as well
| bucket_file_map[b].append(f) | ||
| bucket = buckets[0] | ||
| if len(buckets) > 1: | ||
| logger.warning(f"Multiple buckets provided; using '{bucket}' with folder-based uploads.") |
Contributor
There was a problem hiding this comment.
So from now on we will use only a single bucket no matter how many buckets the user has provided?
Collaborator
Author
There was a problem hiding this comment.
Yes for the customers whoever is using this PR. We don't merge the PR though.
| logger.warning(f"Multiple buckets provided; using '{bucket}' with folder-based uploads.") | ||
|
|
||
| folder_names = [f"{MIGRATION_FOLDER_PREFIX}{idx+1}" for idx in range(len(files))] | ||
| if not ensure_folders_exist(bucket, folder_names): |
Contributor
There was a problem hiding this comment.
ensure_folder_exists actually creates the folders idempotently, we should rename is to create_folders
| logger.debug(f"Uploaded {file_path} -> gs://{bucket_name}/{destination_blob_name}") | ||
| return True | ||
| except Exception as error: | ||
| logger.error("Failed to upload '%s' to bucket '%s' with error '%s'", file_path, bucket_name, error) |
Contributor
There was a problem hiding this comment.
lets log destination_blob_name as well.
Collaborator
Author
There was a problem hiding this comment.
Currently we have the destination blob name log in generated logs file, do we need it in main logs (Directly displayed to user while script is running) also?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.