From 25b31618e736cb08d13f6046a4d3c527ff6278cf Mon Sep 17 00:00:00 2001 From: ncclementi Date: Fri, 7 Feb 2025 10:49:04 -0500 Subject: [PATCH] use Path to get token and address review comments --- .../examples/rapids-snowflake-cudf/notebook.ipynb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/source/examples/rapids-snowflake-cudf/notebook.ipynb b/source/examples/rapids-snowflake-cudf/notebook.ipynb index 7231c307..05c3fc31 100644 --- a/source/examples/rapids-snowflake-cudf/notebook.ipynb +++ b/source/examples/rapids-snowflake-cudf/notebook.ipynb @@ -137,19 +137,14 @@ "outputs": [], "source": [ "import os\n", + "from pathlib import Path\n", "\n", "from snowflake.snowpark import Session\n", "\n", - "\n", - "def get_login_token():\n", - " with open(\"/snowflake/session/token\") as f:\n", - " return f.read()\n", - "\n", - "\n", "connection_parameters = {\n", " \"account\": os.getenv(\"SNOWFLAKE_ACCOUNT\"),\n", " \"host\": os.getenv(\"SNOWFLAKE_HOST\"),\n", - " \"token\": get_login_token(),\n", + " \"token\": Path(\"/snowflake/session/token\").read_text(),\n", " \"authenticator\": \"oauth\",\n", " \"database\": \"CUDF_SNOWFLAKE_EXAMPLE\", # the created database\n", " \"schema\": \"PUBLIC\",\n", @@ -192,9 +187,9 @@ "source": [ "Notice that up to this point, we have a snowpark dataframe. To get a pandas dataframe we use `.to_pandas()`\n", "\n", - "**NOTE:**\n", - "\n", - "At the moment, there is a known issue that is preventing us to accelerate the following step with cudf, and we hope to solve this issue soon. In the meantime we need to do a workaround to get the data into a pandas dataframe that `cudf.pandas` can understand. " + "```{warning}\n", + "At the moment, there is a known issue that is preventing us to accelerate the following step with cudf, and we hope to solve this issue soon. In the meantime we need to do a workaround to get the data into a pandas dataframe that `cudf.pandas` can understand.\n", + "```" ] }, {