Repository: feast-dev/feast

Issue:
feast serve convert number to INT64 
## Expected Behavior 
when we use the get-online-features endpoint the request body numbers converted to Int64 type and while from python file calling get_online_feature function convert number to Int32 which leads to inconsistency between both use 
if the entity value type is Int32 then feature servering with online feast serve command will not work expected behavior is to convert the value to Int32 while it is being converted to Int64
## Current Behavior
when using feast serve number are converted to Int64 type 
## Steps to reproduce
create a entity with a column with type Int32 create a feature view with the entity apply the changes using feast apply materialize the data to online store start feature server using feast serve and call endpoint /get-online-feature to retrive feature ... expected response is the feature retrived  while it show none due to type issue 
### Specifications

- Version: 0.36
- Platform: 
- Subsystem:

## Possible Solution
before converting the type to Int64 get the repo and convert the type to the entity data type defined 
other solution is just write in doc to use Int64 and Float64 type while defining entity



Discussion:
@Akshay-deqode thanks for filing the issue, I was able to reproduce.

Resolving patch:
diff --git a/sdk/python/feast/feature_server.py b/sdk/python/feast/feature_server.py
--- a/sdk/python/feast/feature_server.py
+++ b/sdk/python/feast/feature_server.py
@@ -10,7 +10,7 @@
 from fastapi import FastAPI, HTTPException, Request, Response, status
 from fastapi.logger import logger
 from fastapi.params import Depends
-from google.protobuf.json_format import MessageToDict, Parse
+from google.protobuf.json_format import MessageToDict
 from pydantic import BaseModel
 
 import feast
@@ -18,7 +18,6 @@
 from feast.constants import DEFAULT_FEATURE_SERVER_REGISTRY_TTL
 from feast.data_source import PushMode
 from feast.errors import PushSourceNotFoundException
-from feast.protos.feast.serving.ServingService_pb2 import GetOnlineFeaturesRequest
 
 
 # TODO: deprecate this in favor of push features
@@ -83,34 +82,25 @@ def shutdown_event():
     @app.post("/get-online-features")
     def get_online_features(body=Depends(get_body)):
         try:
-            # Validate and parse the request data into GetOnlineFeaturesRequest Protobuf object
-            request_proto = GetOnlineFeaturesRequest()
-            Parse(body, request_proto)
-
+            body = json.loads(body)
             # Initialize parameters for FeatureStore.get_online_features(...) call
-            if request_proto.HasField("feature_service"):
+            if "feature_service" in body:
                 features = store.get_feature_service(
-                    request_proto.feature_service, allow_cache=True
+                    body["feature_service"], allow_cache=True
                 )
             else:
-                features = list(request_proto.features.val)
-
-            full_feature_names = request_proto.full_feature_names
+                features = body["features"]
 
-            batch_sizes = [len(v.val) for v in request_proto.entities.values()]
-            num_entities = batch_sizes[0]
-            if any(batch_size != num_entities for batch_size in batch_sizes):
-                raise HTTPException(status_code=500, detail="Uneven number of columns")
+            full_feature_names = body.get("full_feature_names", False)
 
             response_proto = store._get_online_features(
                 features=features,
-                entity_values=request_proto.entities,
+                entity_values=body["entities"],
                 full_feature_names=full_feature_names,
-                native_entity_values=False,
             ).proto
 
             # Convert the Protobuf object to JSON and return it
-            return MessageToDict(  # type: ignore
+            return MessageToDict(
                 response_proto, preserving_proto_field_name=True, float_precision=18
             )
         except Exception as e:


Test patch: