@@ -242,14 +242,12 @@ def test_bqml(bq_cmek, session_with_bq_cmek, penguins_table_id):
242
242
model .fit (X_train , y_train )
243
243
244
244
assert model is not None
245
- # TODO(b/340879287): fix type error
246
- assert model ._bqml_model .model .encryption_configuration is not None # type: ignore
247
- # TODO(b/340879287): fix type error
248
- assert model ._bqml_model .model .encryption_configuration .kms_key_name == bq_cmek # type: ignore
245
+ assert model ._bqml_model is not None
246
+ assert model ._bqml_model .model .encryption_configuration is not None
247
+ assert model ._bqml_model .model .encryption_configuration .kms_key_name == bq_cmek
249
248
250
249
# Assert that model exists in BQ with intended encryption
251
- # TODO(b/340879287): fix type error
252
- model_bq = session_with_bq_cmek .bqclient .get_model (model ._bqml_model .model_name ) # type: ignore
250
+ model_bq = session_with_bq_cmek .bqclient .get_model (model ._bqml_model .model_name )
253
251
assert model_bq .encryption_configuration .kms_key_name == bq_cmek
254
252
255
253
# Explicitly save the model to a destination and assert that encryption holds
@@ -260,12 +258,12 @@ def test_bqml(bq_cmek, session_with_bq_cmek, penguins_table_id):
260
258
f"{ model_ref .project } .{ model_ref .dataset_id } .{ model_ref .model_id } "
261
259
)
262
260
new_model = model .to_gbq (model_ref_full_name )
263
- # TODO(b/340879287): fix type error
264
- assert new_model ._bqml_model .model .encryption_configuration .kms_key_name == bq_cmek # type: ignore
261
+ assert new_model ._bqml_model is not None
262
+ assert new_model ._bqml_model .model .encryption_configuration is not None
263
+ assert new_model ._bqml_model .model .encryption_configuration .kms_key_name == bq_cmek
265
264
266
265
# Assert that model exists in BQ with intended encryption
267
- # TODO(b/340879287): fix type error
268
- model_bq = session_with_bq_cmek .bqclient .get_model (new_model ._bqml_model .model_name ) # type: ignore
266
+ model_bq = session_with_bq_cmek .bqclient .get_model (new_model ._bqml_model .model_name )
269
267
assert model_bq .encryption_configuration .kms_key_name == bq_cmek
270
268
271
269
# Assert that model registration keeps the encryption
@@ -279,11 +277,11 @@ def test_bqml(bq_cmek, session_with_bq_cmek, penguins_table_id):
279
277
# https://cloud.google.com/vertex-ai/docs/general/cmek#create_resources_with_the_kms_key.
280
278
# bigframes.ml does not provide any API for the model deployment.
281
279
model_registered = new_model .register ()
282
- # TODO(b/340879287): fix type error
280
+ assert model_registered ._bqml_model is not None
281
+ assert model_registered ._bqml_model .model .encryption_configuration is not None
283
282
assert (
284
- model_registered ._bqml_model .model .encryption_configuration .kms_key_name # type: ignore
283
+ model_registered ._bqml_model .model .encryption_configuration .kms_key_name
285
284
== bq_cmek
286
285
)
287
- # TODO(b/340879287): fix type error
288
- model_bq = session_with_bq_cmek .bqclient .get_model (new_model ._bqml_model .model_name ) # type: ignore
286
+ model_bq = session_with_bq_cmek .bqclient .get_model (new_model ._bqml_model .model_name )
289
287
assert model_bq .encryption_configuration .kms_key_name == bq_cmek
0 commit comments