Skip to content

Float features are materialized into online stores as doubles #1904

Closed

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)

Activity

  1. added
    good first issue
    priority/p0
    on Sep 23, 2021
  2. achals commented on Sep 23, 2021

    @achals
    Member

    Thanks for the bug report @Agent007 - I noticed the same thing yesterday when working on feast-dev/feast-java-old#37.

  3. Agent007 commented on Sep 27, 2021

    @Agent007
    ContributorAuthor

    @achals You're very welcome! I created a PR for the fix. Wasn't sure if you hadn't seen it yet or if you've been busy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issuepriority/p0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions