We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8d4184 commit ac62631Copy full SHA for ac62631
packages/cubejs-backend-native/src/python/entry.rs
@@ -71,6 +71,15 @@ fn python_load_model(mut cx: FunctionContext) -> JsResult<JsPromise> {
71
py_runtime_init(&mut cx, channel.clone())?;
72
73
let conf_res = Python::with_gil(|py| -> PyResult<CubePythonModel> {
74
+ let sys_path = py.import("sys")?.getattr("path")?.downcast::<PyList>()?;
75
+
76
+ let config_dir = Path::new(&model_file_name)
77
+ .parent()
78
+ .unwrap_or_else(|| Path::new("."));
79
+ let config_dir_str = config_dir.to_str().unwrap_or(".");
80
81
+ sys_path.insert(0, PyString::new(py, config_dir_str))?;
82
83
let cube_code = include_str!(concat!(
84
env!("CARGO_MANIFEST_DIR"),
85
"/python/cube/src/__init__.py"
0 commit comments