From a31c30463d0d9cdb3eb7c1b0ecd39c40fb9584f3 Mon Sep 17 00:00:00 2001 From: tokoko Date: Fri, 20 Sep 2024 06:06:22 +0000 Subject: [PATCH] fix: fix linter issues Signed-off-by: tokoko --- sdk/python/feast/utils.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sdk/python/feast/utils.py b/sdk/python/feast/utils.py index 147d15cd0e..35ab885815 100644 --- a/sdk/python/feast/utils.py +++ b/sdk/python/feast/utils.py @@ -771,7 +771,8 @@ def _get_feature_views_to_use( for projection in features.feature_view_projections ] else: - feature_views = [(feature.split(":")[0], None) for feature in features] + assert features is not None + feature_views = [(feature.split(":")[0], None) for feature in features] # type: ignore[misc] fvs_to_use, od_fvs_to_use = [], [] for name, projection in feature_views: @@ -786,13 +787,14 @@ def _get_feature_views_to_use( source_fv = registry.get_any_feature_view( source_projection.name, project, allow_cache ) + # TODO better way to handler dummy entities if ( hide_dummy_entity - and source_fv.entities - and source_fv.entities[0] == DUMMY_ENTITY_NAME + and source_fv.entities # type: ignore[attr-defined] + and source_fv.entities[0] == DUMMY_ENTITY_NAME # type: ignore[attr-defined] ): - source_fv.entities = [] - source_fv.entity_columns = [] + source_fv.entities = [] # type: ignore[attr-defined] + source_fv.entity_columns = [] # type: ignore[attr-defined] if source_fv not in fvs_to_use: fvs_to_use.append( @@ -801,11 +803,11 @@ def _get_feature_views_to_use( else: if ( hide_dummy_entity - and fv.entities - and fv.entities[0] == DUMMY_ENTITY_NAME + and fv.entities # type: ignore[attr-defined] + and fv.entities[0] == DUMMY_ENTITY_NAME # type: ignore[attr-defined] ): - fv.entities = [] - fv.entity_columns = [] + fv.entities = [] # type: ignore[attr-defined] + fv.entity_columns = [] # type: ignore[attr-defined] fvs_to_use.append( fv.with_projection(copy.copy(projection)) if projection else fv )