Skip to content

Commit d0c582a

Browse files
committed
feature: added extra arguments to get feature group as dataframe
1 parent d9463d3 commit d0c582a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/sagemaker/feature_store/feature_group.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,13 @@ def get_query_execution(self) -> Dict[str, Any]:
123123
query_execution_id=self._current_query_execution_id
124124
)
125125

126-
def as_dataframe(self) -> DataFrame:
126+
def as_dataframe(self, **kwargs) -> DataFrame:
127127
"""Download the result of the current query and load it into a DataFrame.
128128
129+
Args:
130+
kwargs: key arguments used for the method pandas.read_csv to be able to have a better tuning on data.
131+
For more info read https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html
132+
129133
Returns:
130134
A pandas DataFrame contains the query result.
131135
"""
@@ -146,7 +150,9 @@ def as_dataframe(self) -> DataFrame:
146150
query_execution_id=self._current_query_execution_id,
147151
filename=output_filename,
148152
)
149-
return pd.read_csv(output_filename, delimiter=",")
153+
154+
kwargs.pop('delimiter', None)
155+
return pd.read_csv(filepath_or_buffer=output_filename, delimiter=",", **kwargs)
150156

151157

152158
@attr.s

0 commit comments

Comments
 (0)