Skip to content

fix: Extracted profile_name directly from sagemaker.Session if None #3660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/sagemaker/feature_store/feature_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,9 @@ def ingest(
if max_workers <= 0:
raise RuntimeError("max_workers must be greater than 0.")

if profile_name is None and self.sagemaker_session.boto_session.profile_name != "default":
profile_name = self.sagemaker_session.boto_session.profile_name

manager = IngestionManagerPandas(
feature_group_name=self.name,
sagemaker_session=self.sagemaker_session,
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/sagemaker/feature_store/test_feature_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def test_ingest(ingestion_manager_init, sagemaker_session_mock, fs_runtime_clien
sagemaker_fs_runtime_client_config=fs_runtime_client_config_mock,
max_workers=10,
max_processes=1,
profile_name=None,
profile_name=sagemaker_session_mock.boto_session.profile_name,
)
mock_ingestion_manager_instance.run.assert_called_once_with(
data_frame=df, wait=True, timeout=None
Expand All @@ -323,6 +323,7 @@ def test_ingest_default(ingestion_manager_init, sagemaker_session_mock):
sagemaker_session_mock.sagemaker_featurestore_runtime_client.meta.config = (
fs_runtime_client_config_mock
)
sagemaker_session_mock.boto_session.profile_name = "default"

feature_group = FeatureGroup(name="MyGroup", sagemaker_session=sagemaker_session_mock)
df = pd.DataFrame(dict((f"float{i}", pd.Series([2.0], dtype="float64")) for i in range(300)))
Expand Down