Model garden4339#78
Conversation
Summary of ChangesHello @bhandarivijay-png, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates various Jupyter notebooks to align with current best practices for interacting with Google Cloud Storage by migrating from the older Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to migrate gsutil commands to their gcloud storage equivalents across several notebooks. While many of the migrations are correct, I've found several instances where the new gcloud commands have incorrect argument ordering, which will cause them to fail. I've provided suggestions to fix these issues. The pull request also includes numerous stylistic formatting changes, which I have not commented on.
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION $BUCKET_NAME" | ||
| "! gcloud storage buckets create --location $REGION $BUCKET_NAME" |
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION $BUCKET_NAME" | ||
| "! gcloud storage buckets create --location=$REGION $BUCKET_NAME" |
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION $BUCKET_NAME" | ||
| "! gcloud storage buckets create --location=$REGION $BUCKET_NAME" |
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION $BUCKET_NAME" | ||
| "! gcloud storage buckets create --location $REGION $BUCKET_NAME" |
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION gs://$BUCKET_NAME" | ||
| "! gcloud storage buckets create --location $REGION gs://$BUCKET_NAME" |
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION gs://$BUCKET_NAME" | ||
| "! gcloud storage buckets create --location $REGION gs://$BUCKET_NAME" |
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION gs://$BUCKET_NAME" | ||
| "! gcloud storage buckets create --location $REGION gs://$BUCKET_NAME" |
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l {REGION} -p {PROJECT_ID} {BUCKET_URI}" | ||
| "! gcloud storage buckets create --location={REGION} --project={PROJECT_ID} {BUCKET_URI}" |
There was a problem hiding this comment.
| " BUCKET_URI = f\"gs://{PROJECT_ID}-tmp-{now}-{str(uuid.uuid4())[:4]}\"\n", | ||
| " BUCKET_NAME = \"/\".join(BUCKET_URI.split(\"/\")[:3])\n", | ||
| " ! gsutil mb -l {REGION} {BUCKET_URI}\n", | ||
| " ! gcloud storage buckets create --location={REGION} {BUCKET_URI}\n", |
| "else:\n", | ||
| " assert BUCKET_URI.startswith(\"gs://\"), \"BUCKET_URI must start with `gs://`.\"\n", | ||
| " shell_output = ! gsutil ls -Lb {BUCKET_NAME} | grep \"Location constraint:\" | sed \"s/Location constraint://\"\n", | ||
| " shell_output = ! gcloud storage ls --full --buckets {BUCKET_NAME} | grep \"Location constraint:\" | sed \"s/Location constraint://\"\n", |
There was a problem hiding this comment.
The --full flag is not a valid option for gcloud storage ls. To get the bucket's location, you should use gcloud storage buckets describe. The subsequent grep and sed commands also need to be updated to parse the new output format.
shell_output = ! gcloud storage buckets describe {BUCKET_NAME} | grep "location:" | sed "s/location: //"
chenges has done gcloud to gsutil