@@ -73,6 +73,7 @@ def test_ctor_w_properties(target_class):
73
73
)
74
74
type_ = "SCALAR_FUNCTION"
75
75
description = "A routine description."
76
+ determinism_level = "NOT_DETERMINISTIC"
76
77
77
78
actual_routine = target_class (
78
79
routine_id ,
@@ -82,6 +83,7 @@ def test_ctor_w_properties(target_class):
82
83
return_type = return_type ,
83
84
type_ = type_ ,
84
85
description = description ,
86
+ determinism_level = determinism_level ,
85
87
)
86
88
87
89
ref = RoutineReference .from_string (routine_id )
@@ -92,6 +94,7 @@ def test_ctor_w_properties(target_class):
92
94
assert actual_routine .return_type == return_type
93
95
assert actual_routine .type_ == type_
94
96
assert actual_routine .description == description
97
+ assert actual_routine .determinism_level == "NOT_DETERMINISTIC"
95
98
96
99
97
100
def test_from_api_repr (target_class ):
@@ -120,6 +123,7 @@ def test_from_api_repr(target_class):
120
123
"routineType" : "SCALAR_FUNCTION" ,
121
124
"someNewField" : "someValue" ,
122
125
"description" : "A routine description." ,
126
+ "determinismLevel" : "DETERMINISTIC" ,
123
127
}
124
128
actual_routine = target_class .from_api_repr (resource )
125
129
@@ -152,6 +156,7 @@ def test_from_api_repr(target_class):
152
156
assert actual_routine .type_ == "SCALAR_FUNCTION"
153
157
assert actual_routine ._properties ["someNewField" ] == "someValue"
154
158
assert actual_routine .description == "A routine description."
159
+ assert actual_routine .determinism_level == "DETERMINISTIC"
155
160
156
161
157
162
def test_from_api_repr_w_minimal_resource (target_class ):
@@ -177,6 +182,7 @@ def test_from_api_repr_w_minimal_resource(target_class):
177
182
assert actual_routine .return_type is None
178
183
assert actual_routine .type_ is None
179
184
assert actual_routine .description is None
185
+ assert actual_routine .determinism_level is None
180
186
181
187
182
188
def test_from_api_repr_w_unknown_fields (target_class ):
@@ -208,6 +214,7 @@ def test_from_api_repr_w_unknown_fields(target_class):
208
214
"returnType" : {"typeKind" : "INT64" },
209
215
"routineType" : "SCALAR_FUNCTION" ,
210
216
"description" : "A routine description." ,
217
+ "determinismLevel" : "DETERMINISM_LEVEL_UNSPECIFIED" ,
211
218
},
212
219
["arguments" ],
213
220
{"arguments" : [{"name" : "x" , "dataType" : {"typeKind" : "INT64" }}]},
@@ -220,6 +227,7 @@ def test_from_api_repr_w_unknown_fields(target_class):
220
227
"returnType" : {"typeKind" : "INT64" },
221
228
"routineType" : "SCALAR_FUNCTION" ,
222
229
"description" : "A routine description." ,
230
+ "determinismLevel" : "DETERMINISM_LEVEL_UNSPECIFIED" ,
223
231
},
224
232
["body" ],
225
233
{"definitionBody" : "x * 3" },
@@ -232,6 +240,7 @@ def test_from_api_repr_w_unknown_fields(target_class):
232
240
"returnType" : {"typeKind" : "INT64" },
233
241
"routineType" : "SCALAR_FUNCTION" ,
234
242
"description" : "A routine description." ,
243
+ "determinismLevel" : "DETERMINISM_LEVEL_UNSPECIFIED" ,
235
244
},
236
245
["language" ],
237
246
{"language" : "SQL" },
@@ -244,6 +253,7 @@ def test_from_api_repr_w_unknown_fields(target_class):
244
253
"returnType" : {"typeKind" : "INT64" },
245
254
"routineType" : "SCALAR_FUNCTION" ,
246
255
"description" : "A routine description." ,
256
+ "determinismLevel" : "DETERMINISM_LEVEL_UNSPECIFIED" ,
247
257
},
248
258
["return_type" ],
249
259
{"returnType" : {"typeKind" : "INT64" }},
@@ -256,6 +266,7 @@ def test_from_api_repr_w_unknown_fields(target_class):
256
266
"returnType" : {"typeKind" : "INT64" },
257
267
"routineType" : "SCALAR_FUNCTION" ,
258
268
"description" : "A routine description." ,
269
+ "determinismLevel" : "DETERMINISM_LEVEL_UNSPECIFIED" ,
259
270
},
260
271
["type_" ],
261
272
{"routineType" : "SCALAR_FUNCTION" },
@@ -268,20 +279,43 @@ def test_from_api_repr_w_unknown_fields(target_class):
268
279
"returnType" : {"typeKind" : "INT64" },
269
280
"routineType" : "SCALAR_FUNCTION" ,
270
281
"description" : "A routine description." ,
282
+ "determinismLevel" : "DETERMINISM_LEVEL_UNSPECIFIED" ,
271
283
},
272
284
["description" ],
273
285
{"description" : "A routine description." },
274
286
),
287
+ (
288
+ {
289
+ "arguments" : [{"name" : "x" , "dataType" : {"typeKind" : "INT64" }}],
290
+ "definitionBody" : "x * 3" ,
291
+ "language" : "SQL" ,
292
+ "returnType" : {"typeKind" : "INT64" },
293
+ "routineType" : "SCALAR_FUNCTION" ,
294
+ "description" : "A routine description." ,
295
+ "determinismLevel" : "DETERMINISM_LEVEL_UNSPECIFIED" ,
296
+ },
297
+ ["determinism_level" ],
298
+ {"determinismLevel" : "DETERMINISM_LEVEL_UNSPECIFIED" },
299
+ ),
275
300
(
276
301
{},
277
- ["arguments" , "language" , "body" , "type_" , "return_type" , "description" ],
302
+ [
303
+ "arguments" ,
304
+ "language" ,
305
+ "body" ,
306
+ "type_" ,
307
+ "return_type" ,
308
+ "description" ,
309
+ "determinism_level" ,
310
+ ],
278
311
{
279
312
"arguments" : None ,
280
313
"definitionBody" : None ,
281
314
"language" : None ,
282
315
"returnType" : None ,
283
316
"routineType" : None ,
284
317
"description" : None ,
318
+ "determinismLevel" : None ,
285
319
},
286
320
),
287
321
(
0 commit comments