Skip to content

Commit f9d8835

Browse files
author
Andrew Crozier
committed
Update to latest client APIs
1 parent 502ed99 commit f9d8835

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

faculty/datasets/pandas.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ def read_csv(project_path, project_id=None, *args, **kwargs):
4040
"""
4141

4242
project_id = project_id or get_context().project_id
43-
object_client = ObjectClient(get_session())
43+
44+
session = get_session()
45+
url = session.service_url(ObjectClient.SERVICE_NAME)
46+
object_client = ObjectClient(url, session)
47+
4448
presigned_url = object_client.presign_download(project_id, project_path)
4549

4650
return pandas.read_csv(presigned_url, *args, **kwargs)
@@ -68,7 +72,10 @@ def to_csv(dataframe, project_path, project_id=None, *args, **kwargs):
6872
"""
6973

7074
project_id = project_id or get_context().project_id
71-
object_client = ObjectClient(get_session())
75+
76+
session = get_session()
77+
url = session.service_url(ObjectClient.SERVICE_NAME)
78+
object_client = ObjectClient(url, session)
7279

7380
content = dataframe.to_csv(path_or_buf=None, *args, **kwargs)
7481

0 commit comments

Comments
 (0)