\n",
" \n",
" 0 | \n",
- " 11012908 | \n",
- " you're welcome! according to the docs it shoul... | \n",
+ " 11231597 | \n",
+ " In your update, why are some of the system fun... | \n",
" 0 | \n",
"
\n",
" \n",
" 1 | \n",
- " 11013760 | \n",
- " You *should* be concerned with the disk being ... | \n",
- " 0 | \n",
+ " 49684807 | \n",
+ " what you have tried so far . ?? | \n",
+ " 1 | \n",
"
\n",
" \n",
" 2 | \n",
- " 11013784 | \n",
- " have you looked at `Integrate` or `NIntegrate`? | \n",
+ " 7623925 | \n",
+ " @Michael: It should work. Perhaps you looked i... | \n",
" 0 | \n",
"
\n",
" \n",
" 3 | \n",
- " 11015512 | \n",
- " sorry, is a typo. The variable name is dist. (... | \n",
+ " 34046685 | \n",
+ " Will it work with SQL compact? Please excuse m... | \n",
" 0 | \n",
"
\n",
" \n",
" 4 | \n",
- " 11016238 | \n",
- " Pfff, I'm having trouble with that formula too... | \n",
+ " 6426146 | \n",
+ " do you know the equation to your pdf? | \n",
" 0 | \n",
"
\n",
" \n",
" 5 | \n",
- " 11016276 | \n",
- " Thanks thinksteep! Does this mean that by usin... | \n",
+ " 60686114 | \n",
+ " m sorry but at least you have to think about it. | \n",
" 0 | \n",
"
\n",
" \n",
" 6 | \n",
- " 11016551 | \n",
- " Jason, thanks for the reply. I've been workin... | \n",
+ " 16631986 | \n",
+ " i think also making disable this by only jquer... | \n",
" 0 | \n",
"
\n",
" \n",
" 7 | \n",
- " 11017973 | \n",
- " I assume an `off` of 0.5 would put be exactly ... | \n",
+ " 16498565 | \n",
+ " I am including these files on my header of the... | \n",
" 0 | \n",
"
\n",
" \n",
" 8 | \n",
- " 11018225 | \n",
- " Thank you very much. I do worry too much abou... | \n",
+ " 26601001 | \n",
+ " wrong answer, you didn't understand the logic | \n",
" 0 | \n",
"
\n",
" \n",
" 9 | \n",
- " 11018370 | \n",
- " @IanClelland, I edited my question a bit. The ... | \n",
+ " 73255842 | \n",
+ " Call the setOnClickListener before return row. | \n",
" 0 | \n",
"
\n",
" \n",
@@ -505,21 +455,21 @@
],
"text/plain": [
" id text score\n",
- "0 11012908 you're welcome! according to the docs it shoul... 0\n",
- "1 11013760 You *should* be concerned with the disk being ... 0\n",
- "2 11013784 have you looked at `Integrate` or `NIntegrate`? 0\n",
- "3 11015512 sorry, is a typo. The variable name is dist. (... 0\n",
- "4 11016238 Pfff, I'm having trouble with that formula too... 0\n",
- "5 11016276 Thanks thinksteep! Does this mean that by usin... 0\n",
- "6 11016551 Jason, thanks for the reply. I've been workin... 0\n",
- "7 11017973 I assume an `off` of 0.5 would put be exactly ... 0\n",
- "8 11018225 Thank you very much. I do worry too much abou... 0\n",
- "9 11018370 @IanClelland, I edited my question a bit. The ... 0\n",
+ "0 11231597 In your update, why are some of the system fun... 0\n",
+ "1 49684807 what you have tried so far . ?? 1\n",
+ "2 7623925 @Michael: It should work. Perhaps you looked i... 0\n",
+ "3 34046685 Will it work with SQL compact? Please excuse m... 0\n",
+ "4 6426146 do you know the equation to your pdf? 0\n",
+ "5 60686114 m sorry but at least you have to think about it. 0\n",
+ "6 16631986 i think also making disable this by only jquer... 0\n",
+ "7 16498565 I am including these files on my header of the... 0\n",
+ "8 26601001 wrong answer, you didn't understand the logic 0\n",
+ "9 73255842 Call the setOnClickListener before return row. 0\n",
"\n",
"[10 rows x 3 columns]"
]
},
- "execution_count": 6,
+ "execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
@@ -539,7 +489,7 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": 24,
"id": "55ed241e",
"metadata": {},
"outputs": [
@@ -549,8 +499,9 @@
"text": [
"Help on function remote_function in module bigframes.pandas:\n",
"\n",
- "remote_function(input_types: 'List[type]', output_type: 'type', dataset: 'Optional[str]' = None, bigquery_connection: 'Optional[str]' = None, reuse: 'bool' = True)\n",
- " Decorator to turn a user defined function into a BigQuery remote function.\n",
+ "remote_function(input_types: 'List[type]', output_type: 'type', dataset: 'Optional[str]' = None, bigquery_connection: 'Optional[str]' = None, reuse: 'bool' = True, name: 'Optional[str]' = None, packages: 'Optional[Sequence[str]]' = None)\n",
+ " Decorator to turn a user defined function into a BigQuery remote function. Check out\n",
+ " the code samples at: https://cloud.google.com/bigquery/docs/remote-functions#bigquery-dataframes.\n",
" \n",
" .. note::\n",
" Please make sure following is setup before using this API:\n",
@@ -576,7 +527,7 @@
" * BigQuery Data Editor (roles/bigquery.dataEditor)\n",
" * BigQuery Connection Admin (roles/bigquery.connectionAdmin)\n",
" * Cloud Functions Developer (roles/cloudfunctions.developer)\n",
- " * Service Account User (roles/iam.serviceAccountUser)\n",
+ " * Service Account User (roles/iam.serviceAccountUser) on the service account `PROJECT_NUMBER-compute@developer.gserviceaccount.com`\n",
" * Storage Object Viewer (roles/storage.objectViewer)\n",
" * Project IAM Admin (roles/resourcemanager.projectIamAdmin) (Only required if the bigquery connection being used is not pre-created and is created dynamically with user credentials.)\n",
" \n",
@@ -602,15 +553,25 @@
" Name of the BigQuery connection. You should either have the\n",
" connection already created in the `location` you have chosen, or\n",
" you should have the Project IAM Admin role to enable the service\n",
- " to create the connection for you if you need it.If this parameter is\n",
+ " to create the connection for you if you need it. If this parameter is\n",
" not provided then the BigQuery connection from the session is used.\n",
" reuse (bool, Optional):\n",
" Reuse the remote function if already exists.\n",
" `True` by default, which will result in reusing an existing remote\n",
- " function (if any) that was previously created for the same udf.\n",
- " Setting it to false would force creating a unique remote function.\n",
+ " function and corresponding cloud function (if any) that was\n",
+ " previously created for the same udf.\n",
+ " Setting it to `False` would force creating a unique remote function.\n",
" If the required remote function does not exist then it would be\n",
" created irrespective of this param.\n",
+ " name (str, Optional):\n",
+ " Explicit name of the persisted BigQuery remote function. Use it with\n",
+ " caution, because two users working in the same project and dataset\n",
+ " could overwrite each other's remote functions if they use the same\n",
+ " persistent name.\n",
+ " packages (str[], Optional):\n",
+ " Explicit name of the external package dependencies. Each dependency\n",
+ " is added to the `requirements.txt` as is, and can be of the form\n",
+ " supported in https://pip.pypa.io/en/stable/reference/requirements-file-format/.\n",
" Returns:\n",
" callable: A remote function object pointing to the cloud assets created\n",
" in the background to support the remote execution. The cloud assets can be\n",
@@ -631,49 +592,16 @@
},
{
"cell_type": "code",
- "execution_count": 8,
- "id": "c9a8d03d",
- "metadata": {},
- "outputs": [],
- "source": [
- "# BigQuery DataFrames user is a data scientist and may not have privileges to\n",
- "# create a BQ connector and set it up for invoking a cloud function. They\n",
- "# should get such a connector created from their cloud admin and use it with\n",
- "# BigQuery DataFrames remote functions. If the provided connection name does not\n",
- "# exist, BigQuery DataFrames will try to create it on the fly assuming the user\n",
- "# has sufficient privileges.\n",
- "bq_connection_name = 'bigframes-rf-conn'"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 9,
+ "execution_count": 25,
"id": "fbc27f81",
"metadata": {},
"outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "[INFO][2023-08-18 21:23:29,687][bigframes.remote_function] Creating new cloud function: gcloud functions deploy bigframes-b0feb1fbaf8188b64d7e70118d93c5d4 --gen2 --runtime=python310 --project=bigframes-dev --region=us-central1 --source=/tmp/tmpl2ewfnue --entry-point=udf_http --trigger-http --no-allow-unauthenticated\n",
- "[INFO][2023-08-18 21:24:43,689][bigframes.remote_function] Successfully created cloud function bigframes-b0feb1fbaf8188b64d7e70118d93c5d4 with uri (https://bigframes-b0feb1fbaf8188b64d7e70118d93c5d4-7krlje3eoq-uc.a.run.app)\n",
- "[INFO][2023-08-18 21:24:57,348][bigframes.remote_function] Connector bigframes-rf-conn already exists\n",
- "[INFO][2023-08-18 21:24:57,351][bigframes.remote_function] Creating BQ remote function: \n",
- " CREATE OR REPLACE FUNCTION `bigframes-dev.bigframes_temp_us`.bigframes_b0feb1fbaf8188b64d7e70118d93c5d4(n INT64)\n",
- " RETURNS INT64\n",
- " REMOTE WITH CONNECTION `bigframes-dev.us.bigframes-rf-conn`\n",
- " OPTIONS (\n",
- " endpoint = \"https://bigframes-b0feb1fbaf8188b64d7e70118d93c5d4-7krlje3eoq-uc.a.run.app\"\n",
- " )\n",
- "[INFO][2023-08-18 21:24:58,300][bigframes.remote_function] Created remote function bigframes-dev.bigframes_temp_us.bigframes_b0feb1fbaf8188b64d7e70118d93c5d4\n"
- ]
- },
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
- "Wall time: 89.0601 s\n"
+ "Wall time: 76.2628 s\n"
]
}
],
@@ -684,7 +612,7 @@
"\n",
"# User defined function\n",
"# https://www.codespeedy.com/find-nth-prime-number-in-python/\n",
- "@pd.remote_function([int], int, bigquery_connection=bq_connection_name)\n",
+ "@pd.remote_function([int], int, reuse=False)\n",
"def nth_prime(n):\n",
" prime_numbers = [2,3]\n",
" i=3\n",
@@ -712,7 +640,7 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 26,
"id": "c1c9355f",
"metadata": {},
"outputs": [
@@ -720,33 +648,17 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "CPU times: user 16.8 ms, sys: 61 µs, total: 16.8 ms\n",
- "Wall time: 17 ms\n"
+ "CPU times: user 55.8 ms, sys: 182 µs, total: 56 ms\n",
+ "Wall time: 54.5 ms\n"
]
},
{
"data": {
- "application/vnd.jupyter.widget-view+json": {
- "model_id": "2f840ad27c514ed19c759a004b32de33",
- "version_major": 2,
- "version_minor": 0
- },
- "text/plain": [
- "HTML(value='Query job 0f421233-9d02-4746-bb39-86a3b0880aba is RUNNING.