Skip to content

Commit

Permalink
Fix bugs in batch retrieval for python sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
zhilingc committed Oct 24, 2019
1 parent 9f72368 commit 81a6703
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions sdk/python/feast/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ def get_batch_features(
# Validate entity rows based on entities in Feast Core
self._validate_entity_rows_for_batch_retrieval(entity_rows, fs_request)

# we want the timestamp column naming to be consistent with the rest of feast
entity_rows.columns = ['event_timestamp' if col=='datetime' else col for col in entity_rows.columns]

# Retrieve serving information to determine store type and staging location
serving_info = (
self._serving_service_stub.GetFeastServingInfo()
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def result(self, timeout_sec: int = DEFAULT_TIMEOUT_SEC):
for file_uri in uris:
if file_uri.scheme == "gs":
file_obj = tempfile.TemporaryFile()
self.storage_client.download_blob_to_file(file_uri, file_obj)
self.storage_client.download_blob_to_file(file_uri.geturl(), file_obj)
elif file_uri.scheme == "file":
file_obj = open(file_uri.path, "rb")
else:
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/feast/utils/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def upload_file_to_gcs(local_path: str, bucket: str, remote_path: str):
"""
storage_client = storage.Client(project=None)
bucket = storage_client.get_bucket(bucket)
blob = bucket.blob(local_path)
blob.upload_from_filename(remote_path)
blob = bucket.blob(remote_path)
blob.upload_from_filename(local_path)


def export_dataframe_to_local(df: pd.DataFrame, dir_path: Optional[str] = None):
Expand Down

0 comments on commit 81a6703

Please sign in to comment.