Skip to content

Commit d065330

Browse files
committed
Fix: DatasetBuilder.to_dataframe() docstring and instantiation
1 parent a9e9706 commit d065330

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

sagemaker-mlops/src/sagemaker/mlops/feature_store/dataset_builder.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,13 @@ def to_csv_file(self) -> tuple[str, str]:
428428
"""Get query string and result in .csv format file.
429429
430430
Returns:
431-
The S3 path of the .csv file.
432-
The query string executed.
431+
tuple: A tuple containing:
432+
- str: The S3 path of the .csv file
433+
- str: The query string executed
434+
435+
Note:
436+
This method returns a tuple (csv_path, query_string).
437+
To get just the CSV path: csv_path, _ = builder.to_csv_file()
433438
"""
434439
if isinstance(self._base, pd.DataFrame):
435440
return self._to_csv_from_dataframe()
@@ -442,8 +447,13 @@ def to_dataframe(self) -> tuple[pd.DataFrame, str]:
442447
"""Get query string and result in pandas.DataFrame.
443448
444449
Returns:
445-
The pandas.DataFrame object.
446-
The query string executed.
450+
tuple: A tuple containing:
451+
- pd.DataFrame: The pandas DataFrame object
452+
- str: The query string executed
453+
454+
Note:
455+
This method returns a tuple (dataframe, query_string).
456+
To get just the DataFrame: df, _ = builder.to_dataframe()
447457
"""
448458
csv_file, query_string = self.to_csv_file()
449459
df = download_csv_from_s3(csv_file, self._sagemaker_session, self._kms_key_id)
@@ -474,8 +484,8 @@ def _to_csv_from_dataframe(self) -> tuple[str, str]:
474484
table_name=temp_table_name,
475485
record_identifier_feature_name=self._record_identifier_feature_name,
476486
event_time_identifier_feature=FeatureDefinition(
477-
self._event_time_identifier_feature_name,
478-
self._event_time_identifier_feature_type,
487+
feature_name=self._event_time_identifier_feature_name,
488+
feature_type=self._event_time_identifier_feature_type,
479489
),
480490
table_type=TableType.DATA_FRAME,
481491
)

0 commit comments

Comments
 (0)