Skip to content

Commit e25ce0d

Browse files
reformatted the file to resolve lint error.
Signed-off-by: Lokesh Rangineni <lokeshforjava@gmail.com>
1 parent 7b50658 commit e25ce0d

1 file changed

Lines changed: 61 additions & 62 deletions

File tree

sdk/python/tests/unit/test_sql_registry.py

Lines changed: 61 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
POSTGRES_PASSWORD = "test"
4343
POSTGRES_DB = "test"
4444

45-
4645
logger = logging.getLogger(__name__)
4746

4847

@@ -145,19 +144,19 @@ def test_apply_entity_success(sql_registry):
145144

146145
entity = entities[0]
147146
assert (
148-
len(entities) == 1
149-
and entity.name == "driver_car_id"
150-
and entity.description == "Car driver id"
151-
and "team" in entity.tags
152-
and entity.tags["team"] == "matchmaking"
147+
len(entities) == 1
148+
and entity.name == "driver_car_id"
149+
and entity.description == "Car driver id"
150+
and "team" in entity.tags
151+
and entity.tags["team"] == "matchmaking"
153152
)
154153

155154
entity = sql_registry.get_entity("driver_car_id", project)
156155
assert (
157-
entity.name == "driver_car_id"
158-
and entity.description == "Car driver id"
159-
and "team" in entity.tags
160-
and entity.tags["team"] == "matchmaking"
156+
entity.name == "driver_car_id"
157+
and entity.description == "Car driver id"
158+
and "team" in entity.tags
159+
and entity.tags["team"] == "matchmaking"
161160
)
162161

163162
# After the first apply, the created_timestamp should be the same as the last_update_timestamp.
@@ -225,31 +224,31 @@ def test_apply_feature_view_success(sql_registry):
225224

226225
# List Feature Views
227226
assert (
228-
len(feature_views) == 1
229-
and feature_views[0].name == "my_feature_view_1"
230-
and feature_views[0].features[0].name == "fs1_my_feature_1"
231-
and feature_views[0].features[0].dtype == Int64
232-
and feature_views[0].features[1].name == "fs1_my_feature_2"
233-
and feature_views[0].features[1].dtype == String
234-
and feature_views[0].features[2].name == "fs1_my_feature_3"
235-
and feature_views[0].features[2].dtype == Array(String)
236-
and feature_views[0].features[3].name == "fs1_my_feature_4"
237-
and feature_views[0].features[3].dtype == Array(Bytes)
238-
and feature_views[0].entities[0] == "fs1_my_entity_1"
227+
len(feature_views) == 1
228+
and feature_views[0].name == "my_feature_view_1"
229+
and feature_views[0].features[0].name == "fs1_my_feature_1"
230+
and feature_views[0].features[0].dtype == Int64
231+
and feature_views[0].features[1].name == "fs1_my_feature_2"
232+
and feature_views[0].features[1].dtype == String
233+
and feature_views[0].features[2].name == "fs1_my_feature_3"
234+
and feature_views[0].features[2].dtype == Array(String)
235+
and feature_views[0].features[3].name == "fs1_my_feature_4"
236+
and feature_views[0].features[3].dtype == Array(Bytes)
237+
and feature_views[0].entities[0] == "fs1_my_entity_1"
239238
)
240239

241240
feature_view = sql_registry.get_feature_view("my_feature_view_1", project)
242241
assert (
243-
feature_view.name == "my_feature_view_1"
244-
and feature_view.features[0].name == "fs1_my_feature_1"
245-
and feature_view.features[0].dtype == Int64
246-
and feature_view.features[1].name == "fs1_my_feature_2"
247-
and feature_view.features[1].dtype == String
248-
and feature_view.features[2].name == "fs1_my_feature_3"
249-
and feature_view.features[2].dtype == Array(String)
250-
and feature_view.features[3].name == "fs1_my_feature_4"
251-
and feature_view.features[3].dtype == Array(Bytes)
252-
and feature_view.entities[0] == "fs1_my_entity_1"
242+
feature_view.name == "my_feature_view_1"
243+
and feature_view.features[0].name == "fs1_my_feature_1"
244+
and feature_view.features[0].dtype == Int64
245+
and feature_view.features[1].name == "fs1_my_feature_2"
246+
and feature_view.features[1].dtype == String
247+
and feature_view.features[2].name == "fs1_my_feature_3"
248+
and feature_view.features[2].dtype == Array(String)
249+
and feature_view.features[3].name == "fs1_my_feature_4"
250+
and feature_view.features[3].dtype == Array(Bytes)
251+
and feature_view.entities[0] == "fs1_my_entity_1"
253252
)
254253
assert feature_view.ttl == timedelta(minutes=5)
255254

@@ -339,19 +338,19 @@ def location_features_from_push(inputs: pd.DataFrame) -> pd.DataFrame:
339338

340339
# List Feature Views
341340
assert (
342-
len(feature_views) == 1
343-
and feature_views[0].name == "location_features_from_push"
344-
and feature_views[0].features[0].name == "first_char"
345-
and feature_views[0].features[0].dtype == String
341+
len(feature_views) == 1
342+
and feature_views[0].name == "location_features_from_push"
343+
and feature_views[0].features[0].name == "first_char"
344+
and feature_views[0].features[0].dtype == String
346345
)
347346

348347
feature_view = sql_registry.get_on_demand_feature_view(
349348
"location_features_from_push", project
350349
)
351350
assert (
352-
feature_view.name == "location_features_from_push"
353-
and feature_view.features[0].name == "first_char"
354-
and feature_view.features[0].dtype == String
351+
feature_view.name == "location_features_from_push"
352+
and feature_view.features[0].name == "first_char"
353+
and feature_view.features[0].dtype == String
355354
)
356355

357356
sql_registry.delete_feature_view("location_features_from_push", project)
@@ -441,51 +440,51 @@ def odfv1(feature_df: pd.DataFrame) -> pd.DataFrame:
441440
on_demand_feature_views = sql_registry.list_on_demand_feature_views(project)
442441

443442
assert (
444-
len(on_demand_feature_views) == 1
445-
and on_demand_feature_views[0].name == "odfv1"
446-
and on_demand_feature_views[0].features[0].name == "odfv1_my_feature_1"
447-
and on_demand_feature_views[0].features[0].dtype == Float32
448-
and on_demand_feature_views[0].features[1].name == "odfv1_my_feature_2"
449-
and on_demand_feature_views[0].features[1].dtype == Int32
443+
len(on_demand_feature_views) == 1
444+
and on_demand_feature_views[0].name == "odfv1"
445+
and on_demand_feature_views[0].features[0].name == "odfv1_my_feature_1"
446+
and on_demand_feature_views[0].features[0].dtype == Float32
447+
and on_demand_feature_views[0].features[1].name == "odfv1_my_feature_2"
448+
and on_demand_feature_views[0].features[1].dtype == Int32
450449
)
451450
request_schema = on_demand_feature_views[0].get_request_data_schema()
452451
assert (
453-
list(request_schema.keys())[0] == "my_input_1"
454-
and list(request_schema.values())[0] == ValueType.INT32
452+
list(request_schema.keys())[0] == "my_input_1"
453+
and list(request_schema.values())[0] == ValueType.INT32
455454
)
456455

457456
feature_view = sql_registry.get_on_demand_feature_view("odfv1", project)
458457
assert (
459-
feature_view.name == "odfv1"
460-
and feature_view.features[0].name == "odfv1_my_feature_1"
461-
and feature_view.features[0].dtype == Float32
462-
and feature_view.features[1].name == "odfv1_my_feature_2"
463-
and feature_view.features[1].dtype == Int32
458+
feature_view.name == "odfv1"
459+
and feature_view.features[0].name == "odfv1_my_feature_1"
460+
and feature_view.features[0].dtype == Float32
461+
and feature_view.features[1].name == "odfv1_my_feature_2"
462+
and feature_view.features[1].dtype == Int32
464463
)
465464
request_schema = feature_view.get_request_data_schema()
466465
assert (
467-
list(request_schema.keys())[0] == "my_input_1"
468-
and list(request_schema.values())[0] == ValueType.INT32
466+
list(request_schema.keys())[0] == "my_input_1"
467+
and list(request_schema.values())[0] == ValueType.INT32
469468
)
470469

471470
# Make sure fv1 is untouched
472471
feature_views = sql_registry.list_feature_views(project)
473472

474473
# List Feature Views
475474
assert (
476-
len(feature_views) == 1
477-
and feature_views[0].name == "my_feature_view_1"
478-
and feature_views[0].features[0].name == "fs1_my_feature_1"
479-
and feature_views[0].features[0].dtype == Int64
480-
and feature_views[0].entities[0] == "fs1_my_entity_1"
475+
len(feature_views) == 1
476+
and feature_views[0].name == "my_feature_view_1"
477+
and feature_views[0].features[0].name == "fs1_my_feature_1"
478+
and feature_views[0].features[0].dtype == Int64
479+
and feature_views[0].entities[0] == "fs1_my_entity_1"
481480
)
482481

483482
feature_view = sql_registry.get_feature_view("my_feature_view_1", project)
484483
assert (
485-
feature_view.name == "my_feature_view_1"
486-
and feature_view.features[0].name == "fs1_my_feature_1"
487-
and feature_view.features[0].dtype == Int64
488-
and feature_view.entities[0] == "fs1_my_entity_1"
484+
feature_view.name == "my_feature_view_1"
485+
and feature_view.features[0].name == "fs1_my_feature_1"
486+
and feature_view.features[0].dtype == Int64
487+
and feature_view.entities[0] == "fs1_my_entity_1"
489488
)
490489

491490
sql_registry.teardown()

0 commit comments

Comments
 (0)