class_docstr: InputLoader that reads data in as a Spark DataFrame.
class_docstr_tok: ["InputLoader","that","reads","data","in","as","a","Spark","DataFrame","."]
docstr: Load the contents of a Feature Group's offline store as a DataFrame.
  
  Args:
      feature_group_data_source (FeatureGroupDataSource): the Feature Group source.
  
  Raises:
      ValueError: If the Feature Group does not have an Offline Store.
      ValueError: If the Feature Group's Table Type is not supported by the feature_processor.
  
  Returns:
      DataFrame: A Spark DataFrame containing the contents of the Feature Group's
          offline store.
docstr_tok: ["Load","the","contents","of","a","Feature","Group","'s","offline","store","as","a","DataFrame",".","Args",":","feature_group_data_source","(","FeatureGroupDataSource",")",":","the","Feature","Group","source",".","Raises",":","ValueError",":","If","the","Feature","Group","does","not","have","an","Offline","Store",".","ValueError",":","If","the","Feature","Group","'s","Table","Type","is","not","supported","by","the","feature_processor",".","Returns",":","DataFrame",":","A","Spark","DataFrame","containing","the","contents","of","the","Feature","Group's","offline","store","."]
code: def load_from_feature_group(
      self, feature_group_data_source: FeatureGroupDataSource
  ) -> DataFrame:
      """Load the contents of a Feature Group's offline store as a DataFrame.
  
      Args:
          feature_group_data_source (FeatureGroupDataSource): the Feature Group source.
  
      Raises:
          ValueError: If the Feature Group does not have an Offline Store.
          ValueError: If the Feature Group's Table Type is not supported by the feature_processor.
  
      Returns:
          DataFrame: A Spark DataFrame containing the contents of the Feature Group's
              offline store.
      """
      sagemaker_session: Session = self.sagemaker_session or Session()
  
      feature_group_name = feature_group_data_source.name
      feature_group = sagemaker_session.describe_feature_group(
          self._parse_name_from_arn(feature_group_name)
      )
      logger.debug(
          "Called describe_feature_group with %s and received: %s",
          feature_group_name,
          feature_group,
      )
  
      if "OfflineStoreConfig" not in feature_group:
          raise ValueError(
              f"Input Feature Groups must have an enabled Offline Store."
              f" Feature Group: {feature_group_name} does not have an Offline Store enabled."
          )
  
      offline_store_uri = feature_group["OfflineStoreConfig"][
          "S3StorageConfig"
      ]["ResolvedOutputS3Uri"]
  
      table_format = feature_group["OfflineStoreConfig"].get(
          "TableFormat", None
      )
  
      if table_format not in self._supported_table_format:
          raise ValueError(
              f"Feature group with table format {table_format} is not supported. "
              f"The table format should be one of {self._supported_table_format}."
          )
  
      start_offset = feature_group_data_source.input_start_offset
      end_offset = feature_group_data_source.input_end_offset
  
      if table_format == "Iceberg":
          data_catalog_config = feature_group["OfflineStoreConfig"][
              "DataCatalogConfig"
          ]
          return self.load_from_iceberg_table(
              IcebergTableDataSource(
                  offline_store_uri,
                  data_catalog_config["Catalog"],
                  data_catalog_config["Database"],
                  data_catalog_config["TableName"],
              ),
              feature_group["EventTimeFeatureName"],
              start_offset,
              end_offset,
          )
  
      return self.load_from_date_partitioned_s3(
          ParquetDataSource(offline_store_uri), start_offset, end_offset
      )
  
imports: from __future__ import absolute_import
  import logging
  import re
  from abc import ABC, abstractmethod
  from typing import Generic, Optional, TypeVar, Union
  import attr
  from pyspark.sql import DataFrame
  from sagemaker import Session
  from sagemaker.feature_store.feature_processor._constants import FEATURE_GROUP_ARN_REGEX_PATTERN
  from sagemaker.feature_store.feature_processor._data_source import CSVDataSource, FeatureGroupDataSource, ParquetDataSource, IcebergTableDataSource
  from sagemaker.feature_store.feature_processor._spark_factory import SparkSessionFactory
  from sagemaker.feature_store.feature_processor._input_offset_parser import InputOffsetParser
  from sagemaker.feature_store.feature_processor._env import EnvironmentHelper
label_desc: Use image node_id 1 for calling the SparkDataFrameInputLoader obj's underlying member method code with example usage: obj.load_from_feature_group(feature_group_data_source) and returns: self, self