diff --git a/prql-python/python/tests/test_all.py b/prql-python/python/tests/test_all.py index 65d549201f1f..ec46f9a72fcc 100644 --- a/prql-python/python/tests/test_all.py +++ b/prql-python/python/tests/test_all.py @@ -20,6 +20,8 @@ def test_all(): res = prql.rq_to_sql(res) assert res is not None + assert len(prql.get_targets()) + assert prql.__version__ is not None # Example from readme diff --git a/prql-python/src/lib.rs b/prql-python/src/lib.rs index 6d1daa08e598..6cbc47e95cbb 100644 --- a/prql-python/src/lib.rs +++ b/prql-python/src/lib.rs @@ -45,6 +45,7 @@ fn prql_python(_py: Python, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(prql_to_pl, m)?)?; m.add_function(wrap_pyfunction!(pl_to_rq, m)?)?; m.add_function(wrap_pyfunction!(rq_to_sql, m)?)?; + m.add_function(wrap_pyfunction!(get_targets, m)?)?; m.add_class::()?; // From https://github.com/PyO3/maturin/issues/100 m.add("__version__", env!("CARGO_PKG_VERSION"))?; @@ -104,6 +105,11 @@ impl From for prql_compiler::Options { } } +#[pyfunction] +pub fn get_targets() -> Vec { + Target::names() +} + #[cfg(not(feature = "extension-module"))] #[cfg(test)] mod test {