|
11 | 11 | import boto3 |
12 | 12 | import pandas |
13 | 13 | import pandas as pd |
14 | | -from pandas import DataFrame, Series, read_csv\ |
15 | | - |
| 14 | +from pandas import DataFrame, Series, read_csv |
| 15 | +from sagemaker.core.utils.utils import Unassigned |
16 | 16 | from sagemaker.mlops.feature_store import FeatureGroup as CoreFeatureGroup, FeatureGroup |
17 | 17 | from sagemaker.core.helper.session_helper import Session |
18 | 18 | from sagemaker.core.s3.client import S3Uploader, S3Downloader |
@@ -369,7 +369,7 @@ def create_athena_query(feature_group_name: str, session: Session): |
369 | 369 | raise RuntimeError("No metastore is configured with this feature group.") |
370 | 370 |
|
371 | 371 | catalog_config = fg.offline_store_config.data_catalog_config |
372 | | - disable_glue = catalog_config.disable_glue_table_creation or False |
| 372 | + disable_glue = getattr(catalog_config, "disable_glue_table_creation", False) or False |
373 | 373 |
|
374 | 374 | return AthenaQuery( |
375 | 375 | catalog=catalog_config.catalog if disable_glue else "AwsDataCatalog", |
@@ -451,7 +451,16 @@ def ingest_dataframe( |
451 | 451 | raise ValueError("max_workers must be greater than 0.") |
452 | 452 |
|
453 | 453 | fg = CoreFeatureGroup.get(feature_group_name=feature_group_name) |
454 | | - feature_definitions = {fd.feature_name: fd.feature_type for fd in fg.feature_definitions} |
| 454 | + feature_definitions = {} |
| 455 | + for fd in fg.feature_definitions: |
| 456 | + collection_type = getattr(fd, "collection_type", None) |
| 457 | + # Handle Unassigned, empty string, or None as None |
| 458 | + if isinstance(collection_type, Unassigned) or collection_type == "" or collection_type is None: |
| 459 | + collection_type = None |
| 460 | + feature_definitions[fd.feature_name] = { |
| 461 | + "FeatureType": fd.feature_type, |
| 462 | + "CollectionType": collection_type, |
| 463 | + } |
455 | 464 |
|
456 | 465 | manager = IngestionManagerPandas( |
457 | 466 | feature_group_name=feature_group_name, |
|
0 commit comments