mirror of
https://github.com/Magnus167/msyrs.git
synced 2025-08-20 04:20:00 +00:00
update create_blacklist_from_qdf function signature to accept metrics as a vector
This commit is contained in:
parent
0443906cc9
commit
ee531deb7a
@ -1,7 +1,6 @@
|
|||||||
use pyo3::{prelude::*, types::PyDict};
|
use pyo3::{prelude::*, types::PyDict};
|
||||||
use pyo3_polars::{PyDataFrame, PySeries};
|
use pyo3_polars::{PyDataFrame, PySeries};
|
||||||
|
|
||||||
|
|
||||||
/// Python wrapper for [`crate::utils::qdf`] module.
|
/// Python wrapper for [`crate::utils::qdf`] module.
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
#[pymodule]
|
#[pymodule]
|
||||||
@ -37,18 +36,18 @@ pub fn get_bdates_series_default_opt(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
#[pyfunction(signature = (df, group_by_cid=None, blacklist_name=None, metric=None))]
|
#[pyfunction(signature = (df, group_by_cid=None, blacklist_name=None, metrics=None))]
|
||||||
pub fn create_blacklist_from_qdf(
|
pub fn create_blacklist_from_qdf(
|
||||||
df: PyDataFrame,
|
df: PyDataFrame,
|
||||||
group_by_cid: Option<bool>,
|
group_by_cid: Option<bool>,
|
||||||
blacklist_name: Option<String>,
|
blacklist_name: Option<String>,
|
||||||
metric: Option<String>,
|
metrics: Option<Vec<String>>,
|
||||||
) -> PyResult<PyObject> {
|
) -> PyResult<PyObject> {
|
||||||
let result = crate::utils::qdf::blacklist::create_blacklist_from_qdf(
|
let result = crate::utils::qdf::blacklist::create_blacklist_from_qdf(
|
||||||
&df.into(),
|
&df.into(),
|
||||||
group_by_cid,
|
group_by_cid,
|
||||||
blacklist_name,
|
blacklist_name,
|
||||||
metric,
|
metrics,
|
||||||
)
|
)
|
||||||
.map_err(|e| PyErr::new::<pyo3::exceptions::PyValueError, _>(format!("{}", e)))?;
|
.map_err(|e| PyErr::new::<pyo3::exceptions::PyValueError, _>(format!("{}", e)))?;
|
||||||
Python::with_gil(|py| {
|
Python::with_gil(|py| {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user