polars_python/functions/
string_cache.rs1use polars_core::StringCacheHolder;
2use pyo3::prelude::*;
3
4#[pyfunction]
5pub fn enable_string_cache() {
6 polars_core::enable_string_cache()
7}
8
9#[pyfunction]
10pub fn disable_string_cache() {
11 polars_core::disable_string_cache()
12}
13
14#[pyfunction]
15pub fn using_string_cache() -> bool {
16 polars_core::using_string_cache()
17}
18
19#[pyclass]
20pub struct PyStringCacheHolder {
21 _inner: StringCacheHolder,
22}
23
24#[pymethods]
25impl PyStringCacheHolder {
26 #[new]
27 fn new() -> Self {
28 Self {
29 _inner: StringCacheHolder::hold(),
30 }
31 }
32}