Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-plan/src/plans/aexpr/function_expr/random.rs
7889 views
1
use strum_macros::IntoStaticStr;
2
3
use super::*;
4
5
#[cfg_attr(feature = "ir_serde", derive(serde::Serialize, serde::Deserialize))]
6
#[derive(Copy, Clone, PartialEq, Debug, IntoStaticStr)]
7
#[strum(serialize_all = "snake_case")]
8
pub enum IRRandomMethod {
9
Shuffle,
10
Sample {
11
is_fraction: bool,
12
with_replacement: bool,
13
shuffle: bool,
14
},
15
}
16
17
impl Hash for IRRandomMethod {
18
fn hash<H: Hasher>(&self, state: &mut H) {
19
std::mem::discriminant(self).hash(state)
20
}
21
}
22
23