pub(crate) fn finish_join(
        &self,
        mut df_left: DataFrame,
        mut df_right: DataFrame,
        suffix: Option<String>,
    ) -> Result<DataFrame> {
        let mut left_names = PlHashSet::with_capacity(df_left.width());

        df_left.columns.iter().for_each(|series| {
            left_names.insert(series.name());
        });

        let mut rename_strs = Vec::with_capacity(df_right.width());

        df_right.columns.iter().for_each(|series| {
            if left_names.contains(series.name()) {
                rename_strs.push(series.name().to_owned())
            }
        });
        let suffix = suffix.as_deref().unwrap_or("_right");

        for name in rename_strs {
            df_right.rename(&name, &format!("{}{}", name, suffix))?;
        }

        drop(left_names);
        df_left.hstack_mut(&df_right.columns)?;
        Ok(df_left)
    }
/// Utility method to finish a join.
Utility method to finish a join.
Utility method to finish a join .
pub(crate) fn finish_join(
        &self,
        mut df_left: DataFrame,
        mut df_right: DataFrame,
        suffix: Option<String>,
    ) -> Result<DataFrame> {
        let mut left_names = PlHashSet::with_capacity(df_left.width());
        df_left.columns.iter().for_each(|series| {
            left_names.insert(series.name());
        });
        let mut rename_strs = Vec::with_capacity(df_right.width());
        df_right.columns.iter().for_each(|series| {
            if left_names.contains(series.name()) {
                rename_strs.push(series.name().to_owned())
            }
        });
        let suffix = suffix.as_deref().unwrap_or("_right");
        for name in rename_strs {
            df_right.rename(&name, &format!("{}{}", name, suffix))?;
        }
        drop(left_names);
        df_left.hstack_mut(&df_right.columns)?;
        Ok(df_left)
    }
pub ( crate ) fn finish_join ( & self , mut df_left : DataFrame , mut df_right : DataFrame , suffix : Option < String > , ) -> Result < DataFrame > { let mut left_names = PlHashSet :: with_capacity ( df_left . width ( ) ) ; df_left . columns . iter ( ) . for_each ( | series | { left_names . insert ( series . name ( ) ) ; } ) ; let mut rename_strs = Vec :: with_capacity ( df_right . width ( ) ) ; df_right . columns . iter ( ) . for_each ( | series | { if left_names . contains ( series . name ( ) ) { rename_strs . push ( series . name ( ) . to_owned ( ) ) } } ) ; let suffix = suffix . as_deref ( ) . unwrap_or ( " " ) ; for name in rename_strs { df_right . rename ( & name , & format ! ( " " name suffix ) ) ? ; } drop ( left_names ) ; df_left . hstack_mut ( & df_right . columns ) ? ; Ok ( df_left ) }
Utility method to finish a join.
Utility method to finish a join .
&self
df_left
DataFrame
df_right
DataFrame
suffix
Option<String>
&self
df_left
DataFrame
df_right
DataFrame
suffix
Option<String>