class_docstr: DatasetBuilder definition.
  
  This class instantiates a DatasetBuilder object that comprises a base, a list of feature names,
  an output path and a KMS key ID.
  
  Attributes:
      _sagemaker_session (Session): Session instance to perform boto calls.
      _base (Union[FeatureGroup, DataFrame]): A base which can be either a FeatureGroup or a
          pandas.DataFrame and will be used to merge other FeatureGroups and generate a Dataset.
      _output_path (str): An S3 URI which stores the output .csv file.
      _record_identifier_feature_name (str): A string representing the record identifier feature
          if base is a DataFrame (default: None).
      _event_time_identifier_feature_name (str): A string representing the event time identifier
          feature if base is a DataFrame (default: None).
      _included_feature_names (List[str]): A list of strings representing features to be
          included in the output. If not set, all features will be included in the output.
          (default: None).
      _kms_key_id (str): A KMS key id. If set, will be used to encrypt the result file
          (default: None).
      _point_in_time_accurate_join (bool): A boolean representing if point-in-time join
          is applied to the resulting dataframe when calling "to_dataframe".
          When set to True, users can retrieve data using “row-level time travel”
          according to the event times provided to the DatasetBuilder. This requires that the
          entity dataframe with event times is submitted as the base in the constructor
          (default: False).
      _include_duplicated_records (bool): A boolean representing whether the resulting dataframe
          when calling "to_dataframe" should include duplicated records (default: False).
      _include_deleted_records (bool): A boolean representing whether the resulting
          dataframe when calling "to_dataframe" should include deleted records (default: False).
      _number_of_recent_records (int): An integer representing how many records will be
          returned for each record identifier (default: 1).
      _number_of_records (int): An integer representing the number of records that should be
          returned in the resulting dataframe when calling "to_dataframe" (default: None).
      _write_time_ending_timestamp (datetime.datetime): A datetime that represents the latest
          write time for a record to be included in the resulting dataset. Records with a
          newer write time will be omitted from the resulting dataset. (default: None).
      _event_time_starting_timestamp (datetime.datetime): A datetime that represents the earliest
          event time for a record to be included in the resulting dataset. Records
          with an older event time will be omitted from the resulting dataset. (default: None).
      _event_time_ending_timestamp (datetime.datetime): A datetime that represents the latest
          event time for a record to be included in the resulting dataset. Records
          with a newer event time will be omitted from the resulting dataset. (default: None).
      _feature_groups_to_be_merged (List[FeatureGroupToBeMerged]): A list of
          FeatureGroupToBeMerged which will be joined to base (default: []).
      _event_time_identifier_feature_type (FeatureTypeEnum): A FeatureTypeEnum representing the
          type of event time identifier feature (default: None).
class_docstr_tok: ["DatasetBuilder","definition",".","This","class","instantiates","a","DatasetBuilder","object","that","comprises","a","base",",","a","list","of","feature","names",",","an","output","path","and","a","KMS","key","ID",".","Attributes",":","_sagemaker_session","(","Session",")",":","Session","instance","to","perform","boto","calls",".","_base","(","Union","[","FeatureGroup",",","DataFrame","]",")",":","A","base","which","can","be","either","a","FeatureGroup","or","a","pandas.DataFrame","and","will","be","used","to","merge","other","FeatureGroups","and","generate","a","Dataset",".","_output_path","(","str",")",":","An","S3","URI","which","stores","the","output",".csv","file",".","_record_identifier_feature_name","(","str",")",":","A","string","representing","the","record","identifier","feature","if","base","is","a","DataFrame","(","default",":","None",")",".","_event_time_identifier_feature_name","(","str",")",":","A","string","representing","the","event","time","identifier","feature","if","base","is","a","DataFrame","(","default",":","None",")",".","_included_feature_names","(","List","[","str","]",")",":","A","list","of","strings","representing","features","to","be","included","in","the","output",".","If","not","set",",","all","features","will","be","included","in","the","output",".","(","default",":","None",")",".","_kms_key_id","(","str",")",":","A","KMS","key","id",".","If","set",",","will","be","used","to","encrypt","the","result","file","(","default",":","None",")",".","_point_in_time_accurate_join","(","bool",")",":","A","boolean","representing","if","point-in-time","join","is","applied","to","the","resulting","dataframe","when","calling","``","to_dataframe","''",".","When","set","to","True",",","users","can","retrieve","data","using","\u201c","row-level","time","travel","\u201d","according","to","the","event","times","provided","to","the","DatasetBuilder",".","This","requires","that","the","entity","dataframe","with","event","times","is","submitted","as","the","base","in","the","constructor","(","default",":","False",")",".","_include_duplicated_records","(","bool",")",":","A","boolean","representing","whether","the","resulting","dataframe","when","calling","``","to_dataframe","''","should","include","duplicated","records","(","default",":","False",")",".","_include_deleted_records","(","bool",")",":","A","boolean","representing","whether","the","resulting","dataframe","when","calling","``","to_dataframe","''","should","include","deleted","records","(","default",":","False",")",".","_number_of_recent_records","(","int",")",":","An","integer","representing","how","many","records","will","be","returned","for","each","record","identifier","(","default",":","1",")",".","_number_of_records","(","int",")",":","An","integer","representing","the","number","of","records","that","should","be","returned","in","the","resulting","dataframe","when","calling","``","to_dataframe","''","(","default",":","None",")",".","_write_time_ending_timestamp","(","datetime.datetime",")",":","A","datetime","that","represents","the","latest","write","time","for","a","record","to","be","included","in","the","resulting","dataset",".","Records","with","a","newer","write","time","will","be","omitted","from","the","resulting","dataset",".","(","default",":","None",")",".","_event_time_starting_timestamp","(","datetime.datetime",")",":","A","datetime","that","represents","the","earliest","event","time","for","a","record","to","be","included","in","the","resulting","dataset",".","Records","with","an","older","event","time","will","be","omitted","from","the","resulting","dataset",".","(","default",":","None",")",".","_event_time_ending_timestamp","(","datetime.datetime",")",":","A","datetime","that","represents","the","latest","event","time","for","a","record","to","be","included","in","the","resulting","dataset",".","Records","with","a","newer","event","time","will","be","omitted","from","the","resulting","dataset",".","(","default",":","None",")",".","_feature_groups_to_be_merged","(","List","[","FeatureGroupToBeMerged","]",")",":","A","list","of","FeatureGroupToBeMerged","which","will","be","joined","to","base","(","default",":","[","]",")",".","_event_time_identifier_feature_type","(","FeatureTypeEnum",")",":","A","FeatureTypeEnum","representing","the","type","of","event","time","identifier","feature","(","default",":","None",")","."]
docstr: Get query string and result in pandas.Dataframe
  
  Returns:
      The pandas.DataFrame object.
      The query string executed.
docstr_tok: ["Get","query","string","and","result","in","pandas.Dataframe","Returns",":","The","pandas.DataFrame","object",".","The","query","string","executed","."]
code: def to_dataframe(self) -> Tuple[pd.DataFrame, str]:
      """Get query string and result in pandas.Dataframe
  
      Returns:
          The pandas.DataFrame object.
          The query string executed.
      """
      csv_file, query_string = self.to_csv_file()
      s3.S3Downloader.download(
          s3_uri=csv_file,
          local_path="./",
          kms_key=self._kms_key_id,
          sagemaker_session=self._sagemaker_session,
      )
      local_file_name = csv_file.split("/")[-1]
      df = pd.read_csv(local_file_name)
      os.remove(local_file_name)
  
      local_metadata_file_name = local_file_name + ".metadata"
      if os.path.exists(local_metadata_file_name):
          os.remove(local_file_name + ".metadata")
  
      if "row_recent" in df:
          df = df.drop("row_recent", axis="columns")
      return df, query_string
  
imports: from __future__ import absolute_import
  import datetime
  from enum import Enum
  import os
  from typing import Any, Dict, List, Tuple, Union
  import attr
  import pandas
  from sagemaker import Session, s3, utils
  from sagemaker.feature_store.feature_group import FeatureDefinition, FeatureGroup, FeatureTypeEnum
label_desc: Use image node_id 10 for calling the DatasetBuilder obj's underlying member method code with example usage: obj.to_dataframe() and returns: df,  query_string