Skip to content

Float features are materialized into online stores as doubles #1904

Description

@Agent007

Expected Behavior

For features defined as floats, online retrieval should NOT return double type.

Current Behavior

Float features are materialized into online stores as double type.

Steps to reproduce

Add the following assertion inside the _assert_online_features() function in test_e2e_local.py:

assert response.field_values[0].fields[f"driver_hourly_stats__conv_rate"].float_val > 0

Specifications

  • Version: 0.13.0
  • Platform: all
  • Subsystem: Python SDK

Possible Solution

In the function python_value_to_proto_value() of type_map.py,
value_type perhaps should be set to feature_type if feature_type is not None:

def python_value_to_proto_value(
    value: Any, feature_type: ValueType = None
) -> ProtoValue:
    value_type = (
        feature_type
        if feature_type is not None
        else python_type_to_feast_value_type("", value)
    )
    return _python_value_to_proto_value(value_type, value)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions