From 86c1c29643f096d069a1bb745f93182224ad2a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Swe=C3=B1a=20=28Swast=29?= Date: Mon, 19 May 2025 11:58:11 -0500 Subject: [PATCH 1/2] docs: fix type in output_schema sample notebook --- .../bq_dataframes_llm_output_schema.ipynb | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/notebooks/generative_ai/bq_dataframes_llm_output_schema.ipynb b/notebooks/generative_ai/bq_dataframes_llm_output_schema.ipynb index 0efac1eee3..34aa099e12 100644 --- a/notebooks/generative_ai/bq_dataframes_llm_output_schema.ipynb +++ b/notebooks/generative_ai/bq_dataframes_llm_output_schema.ipynb @@ -361,7 +361,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "You can also get float or int values, for example, to get polulations in millions:" + "You can also get float or int values, for example, to get populations in millions:" ] }, { @@ -400,7 +400,7 @@ " \n", " \n", " city\n", - " polulation_million\n", + " population_million\n", " \n", " \n", " \n", @@ -425,7 +425,7 @@ "[3 rows x 2 columns in total]" ], "text/plain": [ - " city polulation_million\n", + " city population_million\n", "0 Seattle 0.75\n", "1 New York 19.68\n", "2 Shanghai 26.32\n", @@ -439,8 +439,8 @@ } ], "source": [ - "result = gemini.predict(df, prompt=[\"what is the population in millions of\", df[\"city\"]], output_schema={\"polulation_million\": \"float64\"})\n", - "result[[\"city\", \"polulation_million\"]]" + "result = gemini.predict(df, prompt=[\"what is the population in millions of\", df[\"city\"]], output_schema={\"population_million\": \"float64\"})\n", + "result[[\"city\", \"population_million\"]]" ] }, { @@ -576,7 +576,7 @@ " \n", " city\n", " is_US_city\n", - " polulation_in_millions\n", + " population_in_millions\n", " rainy_days_per_year\n", " \n", " \n", @@ -608,7 +608,7 @@ "[3 rows x 4 columns in total]" ], "text/plain": [ - " city is_US_city polulation_in_millions rainy_days_per_year\n", + " city is_US_city population_in_millions rainy_days_per_year\n", "0 Seattle True 0.75 152\n", "1 New York True 8.8 121\n", "2 Shanghai False 26.32 115\n", @@ -622,8 +622,8 @@ } ], "source": [ - "result = gemini.predict(df, prompt=[df[\"city\"]], output_schema={\"is_US_city\": \"bool\", \"polulation_in_millions\": \"float64\", \"rainy_days_per_year\": \"int64\"})\n", - "result[[\"city\", \"is_US_city\", \"polulation_in_millions\", \"rainy_days_per_year\"]]" + "result = gemini.predict(df, prompt=[df[\"city\"]], output_schema={\"is_US_city\": \"bool\", \"population_in_millions\": \"float64\", \"rainy_days_per_year\": \"int64\"})\n", + "result[[\"city\", \"is_US_city\", \"population_in_millions\", \"rainy_days_per_year\"]]" ] }, { @@ -677,7 +677,7 @@ " \n", " city\n", " is_US_city\n", - " polulation_in_millions\n", + " population_in_millions\n", " rainy_days_per_year\n", " places_to_visit\n", " gps_coordinates\n", @@ -717,7 +717,7 @@ "[3 rows x 6 columns in total]" ], "text/plain": [ - " city is_US_city polulation_in_millions rainy_days_per_year \\\n", + " city is_US_city population_in_millions rainy_days_per_year \\\n", "0 Seattle True 0.74 150 \n", "1 New York True 8.4 121 \n", "2 Shanghai False 26.32 115 \n", @@ -741,8 +741,8 @@ } ], "source": [ - "result = gemini.predict(df, prompt=[df[\"city\"]], output_schema={\"is_US_city\": \"bool\", \"polulation_in_millions\": \"float64\", \"rainy_days_per_year\": \"int64\", \"places_to_visit\": \"array\", \"gps_coordinates\": \"struct\"})\n", - "result[[\"city\", \"is_US_city\", \"polulation_in_millions\", \"rainy_days_per_year\", \"places_to_visit\", \"gps_coordinates\"]]" + "result = gemini.predict(df, prompt=[df[\"city\"]], output_schema={\"is_US_city\": \"bool\", \"population_in_millions\": \"float64\", \"rainy_days_per_year\": \"int64\", \"places_to_visit\": \"array\", \"gps_coordinates\": \"struct\"})\n", + "result[[\"city\", \"is_US_city\", \"population_in_millions\", \"rainy_days_per_year\", \"places_to_visit\", \"gps_coordinates\"]]" ] } ], From 14efcd3133ce141fbe1fe08339cf5f9a44412e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Swe=C3=B1a=20=28Swast=29?= Date: Mon, 19 May 2025 11:59:29 -0500 Subject: [PATCH 2/2] Update bq_dataframes_llm_output_schema.ipynb --- .../generative_ai/bq_dataframes_llm_output_schema.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notebooks/generative_ai/bq_dataframes_llm_output_schema.ipynb b/notebooks/generative_ai/bq_dataframes_llm_output_schema.ipynb index 34aa099e12..04ea0571df 100644 --- a/notebooks/generative_ai/bq_dataframes_llm_output_schema.ipynb +++ b/notebooks/generative_ai/bq_dataframes_llm_output_schema.ipynb @@ -400,7 +400,7 @@ " \n", " \n", " city\n", - " population_million\n", + " population_in_millions\n", " \n", " \n", " \n", @@ -425,7 +425,7 @@ "[3 rows x 2 columns in total]" ], "text/plain": [ - " city population_million\n", + " city population_in_millions\n", "0 Seattle 0.75\n", "1 New York 19.68\n", "2 Shanghai 26.32\n", @@ -439,8 +439,8 @@ } ], "source": [ - "result = gemini.predict(df, prompt=[\"what is the population in millions of\", df[\"city\"]], output_schema={\"population_million\": \"float64\"})\n", - "result[[\"city\", \"population_million\"]]" + "result = gemini.predict(df, prompt=[\"what is the population in millions of\", df[\"city\"]], output_schema={\"population_in_millions\": \"float64\"})\n", + "result[[\"city\", \"population_in_millions\"]]" ] }, {