Skip to content

Commit f90a384

Browse files
authored
chore(cubejs-backend-native): Fix Clippy warnings with python feature and setup CI (#8578)
1 parent 175ade1 commit f90a384

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

.github/workflows/rust-cubesql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
run: cd packages/cubejs-backend-native && cargo fmt --all -- --check
4646
- name: Clippy Native
4747
run: cd packages/cubejs-backend-native && cargo clippy -- -D warnings
48+
- name: Clippy Native (with Python)
49+
run: cd packages/cubejs-backend-native && cargo clippy --features python -- -D warnings
4850
# CubeSQL is not ready for Clippy
4951
#- name: Clippy CubeSQL
5052
# run: cd rust/cubesql && cargo clippy -- -D warnings

packages/cubejs-backend-native/src/cross/clrepr_python.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl CLReprPython for CLRepr {
2929
return Ok(Self::Null);
3030
}
3131

32-
return Ok(if v.get_type().is_subclass_of::<PyString>()? {
32+
Ok(if v.get_type().is_subclass_of::<PyString>()? {
3333
let string_type = if v.hasattr("is_safe")? {
3434
StringType::Safe
3535
} else {
@@ -123,7 +123,7 @@ impl CLReprPython for CLRepr {
123123
}
124124

125125
Self::PythonRef(PythonRef::PyObject(v.into()))
126-
});
126+
})
127127
}
128128

129129
fn into_py_impl(from: CLRepr, py: Python) -> Result<PyObject, PyErr> {

packages/cubejs-backend-native/src/cross/py_in_js.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub fn cl_repr_py_function_wrapper(mut cx: FunctionContext) -> JsResult<JsPromis
3434
.this::<JsValue>()?
3535
.downcast_or_throw::<BoxedJsPyFunctionWrapper, _>(&mut cx)?;
3636

37-
let mut arguments = Vec::with_capacity(cx.len() as usize);
37+
let mut arguments = Vec::with_capacity(cx.len());
3838

3939
for arg_idx in 0..cx.len() {
4040
arguments.push(CLRepr::from_js_ref(

packages/cubejs-backend-native/src/python/cube_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl CubeConfigPy {
6666
}
6767

6868
pub fn attr(&mut self, config_module: &PyAny, key: &str) -> PyResult<()> {
69-
let v = config_module.getattr(&*key)?;
69+
let v = config_module.getattr(key)?;
7070
if !v.is_none() {
7171
let value = CLRepr::from_python_ref(v)?;
7272
self.properties.insert(key.to_case(Case::Camel), value);

0 commit comments

Comments
 (0)