def cast_to_inferred(data: Sequence, typeset: VisionsTypeset) -> Sequence: """Casts a DataFrame into a typeset by first performing column wise type inference against a provided typeset Args: data: the DataFrame to cast typeset: the Typeset in which we cast Returns: A tuple of the casted DataFrame and the types to which the columns were cast """ return typeset.cast_to_inferred(data)
def cast_to_inferred(data: Union[pd.Series, pd.DataFrame], typeset: VisionsTypeset) -> Tuple[pd.DataFrame, dict]: """Casts a DataFrame into a typeset by first performing column wise type inference against a provided typeset Args: df: the DataFrame to cast typeset: the Typeset in which we cast Returns: A tuple of the casted DataFrame and the types to which the columns were cast """ return typeset.cast_to_inferred(data)