feat(feature-store): Add lineage registration to DatasetBuilder#6014
feat(feature-store): Add lineage registration to DatasetBuilder#6014Vishakha263 wants to merge 3 commits into
Conversation
| try: | ||
| from sagemaker.core.resources import HubContent | ||
|
|
||
| HubContent.import_hub_content( |
There was a problem hiding this comment.
Instead of calling HubContent.import_hub_content directly, might consider to use DataSet.create from sagemaker.ai_registry.dataset. It handles document construction and schema compliance internally. We'd need to extend DataSet.create to accept a metadata param for passing sourceFeatureGroups though.
5bf9a4c to
94c35d2
Compare
94c35d2 to
c323ce4
Compare
Add register_as_dataset parameter to DatasetBuilder.create() that registers the built dataset as a HubContent with source feature group ARNs in ContentMetadata. This enables auto-lineage between Feature Groups and Training Jobs via SM Dataset (HubContent) as bridge. Changes: - Add register_as_dataset flag to DatasetBuilder.create() - Collect source FG ARNs from base and merged feature groups - Call HubContent.import_hub_content() with sourceFeatureGroups, extractionMethod, and athenaQueryExecutionId metadata - Graceful fallback on AccessDenied or generic errors (logs warning) - Add 10 unit tests covering opt-in, ARN collection, dedup, DataFrame path, HubContent invocation, error handling
c323ce4 to
f9fee9f
Compare
|
Claude finished @rsareddy0329's task in 2m 14s —— View job PR Review: Add lineage registration to DatasetBuilder
🔴 Blocking: the feature never actually runs
The wiring needs to be added, e.g. in csv_path, query_string = ... # result of the two branches
if self._register_as_dataset:
self._register_as_hub_content_dataset(csv_path)
return csv_path, query_stringAll 10 new unit tests call 🟠
|
Description
Add optional lineage registration to DatasetBuilder that creates a SM Dataset (HubContent) after extracting features from Feature Groups. This enables automatic lineage tracking between Feature Groups and Training Jobs.
Motivation
SageMaker's auto-lineage currently has a gap: there's no connection between Feature Groups and Training Jobs. When a customer extracts features via DatasetBuilder.to_csv_file() and uses the resulting CSV for training, that relationship is lost. This PR fills that gap by registering the extraction as a SM Dataset with source Feature Group metadata.
Implementation details:
Files changed:
Testing
Added 10 unit tests in TestDatasetBuilderRegisterAsDataset:
Permissions required (for customers who opt in)
sagemaker:ImportHubContent on the execution role. If missing, a warning is logged and the CSV is still returned.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.