1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use crate::prelude::*;

impl From<StructChunked> for DataFrame {
    fn from(ca: StructChunked) -> Self {
        #[cfg(feature = "object")]
        {
            DataFrame::new_no_checks(ca.fields.clone())
        }
        #[cfg(not(feature = "object"))]
        {
            DataFrame::new_no_checks(ca.fields)
        }
    }
}

impl DataFrame {
    pub fn into_struct(self, name: &str) -> StructChunked {
        StructChunked::new(name, &self.columns).unwrap()
    }
}