@@ -71,6 +71,14 @@ def add(x,y):
71
71
client.deploy(' add' , add, ' Adds two numbers x and y' )
72
72
```
73
73
74
+ If you would like your function to be visible in Tableau using the Custom Functions
75
+ Explorer, you will need to deploy setting the optional ` is_public ` parameter to True.
76
+ Functions that have ` is_public ` set to False, or unset will not be visible.
77
+
78
+ ``` python
79
+ client.deploy(' add' , add, ' Adds two numbers x and y' , is_public = True )
80
+ ```
81
+
74
82
The next example is more complex, using scikit-learn's clustering API:
75
83
76
84
``` python
@@ -100,16 +108,6 @@ endpoint named `clustering`.
100
108
It is now reachable as a [ REST API] ( server-rest.md#httppost-queryendpoint ) , as
101
109
well as through the TabPy tools - for details see the next section.
102
110
103
- You can re-deploy a function (for example, after you modified its code) by setting
104
- the ` override ` parameter to ` True ` :
105
-
106
- ``` python
107
- client.deploy(' add' , add, ' Adds two numbers x and y' , override = True )
108
- ```
109
-
110
- Each re-deployment of an endpoint will increment its version number, which is also
111
- returned as part of the query result.
112
-
113
111
When deploying endpoints which rely on supervised learning models, you may want to
114
112
load a saved model instead of training on-the-fly for performance reasons.
115
113
@@ -158,9 +156,63 @@ The endpoints that are no longer needed can be removed the following way:
158
156
``` python
159
157
160
158
client.remove(' WillItDefault' )
159
+ ```
160
+
161
+ ## Updating Existing Functions
162
+
163
+ You can re-deploy a function (for example, after you modified its code) by setting
164
+ the ` override ` parameter to ` True ` :
165
+
166
+ ``` python
167
+ client.deploy(' add' , add, ' Adds two numbers x and y' , override = True )
168
+ ```
169
+
170
+ Each re-deployment of an endpoint will increment its version number, which is also
171
+ returned as part of the query result.
172
+
173
+ If you do not want to modify the code of a function, you have the option to
174
+ update using ` update_endpoint_info ` . This allows users to update the
175
+ description, schema, or whether a function is public using just the function
176
+ name.
161
177
178
+ To update the description of an existing function:
179
+
180
+ ``` python
181
+ client.update_endpoint_info(' add' , description = ' Updated description for add' )
162
182
```
163
183
184
+ To update whether an existing function is public:
185
+
186
+ ``` python
187
+ client.update_endpoint_info(' add' , is_public = True )
188
+ ```
189
+
190
+ To update the schema associated with an existing function:
191
+
192
+ ``` python
193
+ updatedSchema = generate_schema(
194
+ input = {' x' : 3 , ' y' : 2 },
195
+ output = 5 ,
196
+ input_description = {' x' : ' first value' ,
197
+ ' y' : ' second value' },
198
+ output_description = ' the sum of x and y' )
199
+
200
+
201
+ client.update_endpoint_info(' add' , schema = updatedSchema)
202
+ ```
203
+
204
+ To update ` description ` , ` is_public ` , and ` schema ` all at once:
205
+
206
+ ``` python
207
+ client.update_endpoint_info(' add' ,
208
+ is_public = True ,
209
+ description = ' Updated description for add' ,
210
+ schema = updatedSchema)
211
+ ```
212
+
213
+ Each update of an endpoint will increment its version number, which is also
214
+ returned as part of the query result.
215
+
164
216
## Predeployed Functions
165
217
166
218
### Deploying Models Shipped With TabPy
0 commit comments