Skip to content

Commit

Permalink
feat(rust): add CompatLevel::get_level()
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihe774 committed Jul 7, 2024
1 parent d0918b8 commit 12287aa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/polars-core/src/datatypes/dtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -805,11 +805,18 @@ impl CompatLevel {
CompatLevel(0)
}

// The following methods are only used internally

#[doc(hidden)]
pub fn with_level(level: u16) -> PolarsResult<CompatLevel> {
if level > CompatLevel::newest().0 {
polars_bail!(InvalidOperation: "invalid compat level");
}
Ok(CompatLevel(level))
}

#[doc(hidden)]
pub fn get_level(&self) -> u16 {
self.0
}
}

0 comments on commit 12287aa

Please sign in to comment.