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 2da84eb commit 2c6eeb6Copy full SHA for 2c6eeb6
packages/cubejs-backend-native/src/python/entry.rs
@@ -79,6 +79,15 @@ fn python_load_model(mut cx: FunctionContext) -> JsResult<JsPromise> {
79
py_runtime_init(&mut cx, channel.clone())?;
80
81
let conf_res = Python::with_gil(|py| -> PyResult<CubePythonModel> {
82
+ let sys_path = py.import("sys")?.getattr("path")?.downcast::<PyList>()?;
83
+
84
+ let config_dir = Path::new(&model_file_name)
85
+ .parent()
86
+ .unwrap_or_else(|| Path::new("."));
87
+ let config_dir_str = config_dir.to_str().unwrap_or(".");
88
89
+ sys_path.insert(0, PyString::new(py, config_dir_str))?;
90
91
let cube_code = include_str!(concat!(
92
env!("CARGO_MANIFEST_DIR"),
93
"/python/cube/src/__init__.py"
0 commit comments