def cast_to_detected(data: Sequence, typeset: VisionsTypeset) -> Sequence: """Casts a DataFrame into a typeset by first performing column wise type detection 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_detected(data)
def cast_to_detected(data: Union[pd.Series, pd.DataFrame], typeset: VisionsTypeset) -> pd.DataFrame: """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_detected(data)