@@ -99,6 +99,7 @@ def __init__(
9999 features : Optional [List [tdf_mod .TrainingDatasetFeature ]] = None ,
100100 serving_keys : Optional [List [sk_mod .ServingKey ]] = None ,
101101 skip_fg_ids : Optional [Set [int ]] = None ,
102+ skip_feature_decoding_fg_ids : Optional [Set [int ]] = None ,
102103 feature_store_name : Optional [str ] = None ,
103104 feature_view_name : Optional [str ] = None ,
104105 feature_view_version : Optional [int ] = None ,
@@ -166,6 +167,7 @@ def __init__(
166167 self ._parent_feature_groups : List [FeatureGroup ] = []
167168 self .__all_features_on_demand : Optional [bool ] = None
168169 self .__all_feature_groups_online : Optional [bool ] = None
170+ self ._skip_feature_decoding_fg_ids = skip_feature_decoding_fg_ids or set ()
169171
170172 def init_serving (
171173 self ,
@@ -1405,11 +1407,13 @@ def apply_return_value_handlers(
14051407 return row_dict
14061408
14071409 def build_complex_feature_decoders (self ) -> Dict [str , Callable ]:
1408- """Build a dictionary of functions to deserialize or convert feature values .
1410+ """Build decoders for complex features .
14091411
1410- Handles:
1411- - deserialization of complex features from the online feature store
1412- - conversion of string or int timestamps to datetime objects
1412+ Decodes feature values for features marked as complex (e.g., structs, arrays, maps)
1413+ that are stored in the online store as Avro-encoded payloads (bytes or base64 strings).
1414+ Values already provided as native Python objects (e.g., via passed_features or REST)
1415+ are returned unchanged. Embedding vectors are already deserialized, but complex features
1416+ stored in OpenSearch must be deserialized here. Timestamp conversion is handled separately.
14131417 """
14141418 if not HAS_AVRO :
14151419 raise ModuleNotFoundError (avro_not_installed_message )
@@ -1423,7 +1427,7 @@ def build_complex_feature_decoders(self) -> Dict[str, Callable]:
14231427 )
14241428 )
14251429 for f in self ._features
1426- if f .is_complex ()
1430+ if f .is_complex () and f . feature_group . id not in self . _skip_feature_decoding_fg_ids
14271431 }
14281432
14291433 if len (complex_feature_schemas ) == 0 :
0 commit comments