Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Klegar <[email protected]>
  • Loading branch information
jklegar committed Dec 28, 2020
1 parent ff006c7 commit 2c4f0fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sdk/python/feast/staging/storage_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def download_file(self, uri: ParseResult) -> IO[bytes]:
Returns:
TemporaryFile object
"""
bucket, path = _uri_to_bucket_key(uri)
bucket, path = self._uri_to_bucket_key(uri)
container_client = self.blob_service_client.get_container_client(bucket)
return container_client.download_blob(path).readall()

Expand All @@ -357,7 +357,7 @@ def list_files(self, uri: ParseResult) -> List[str]:
remote staging location.
"""

bucket, path = _uri_to_bucket_key(uri)
bucket, path = self._uri_to_bucket_key(uri)
if "*" in path:
regex = re.compile(path.replace("*", ".*?").strip("/"))
container_client = self.blob_service_client.get_container_client(bucket)
Expand All @@ -373,8 +373,8 @@ def list_files(self, uri: ParseResult) -> List[str]:
else:
return [f"{self.account_url}/{bucket}/{path}"]

def _uri_to_bucket_key(self, remote_path: ParseResult) -> Tuple[str, str]:
assert remote_path.hostname is not None
def _uri_to_bucket_key(self, uri: ParseResult) -> Tuple[str, str]:
assert uri.hostname is not None
bucket = uri.path.lstrip("/").split("/")[0]
key = uri.path.lstrip("/").split("/", 1)[1]
return bucket, key
Expand Down

0 comments on commit 2c4f0fc

Please sign in to comment.