diff --git a/Cargo.lock b/Cargo.lock index c5bc822f7..77e14bfe1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -851,7 +851,7 @@ dependencies = [ [[package]] name = "connectorx" -version = "0.3.2" +version = "0.3.3-alpha.1" dependencies = [ "anyhow", "arrow", @@ -907,7 +907,7 @@ dependencies = [ [[package]] name = "connectorx-cpp" -version = "0.3.2" +version = "0.3.3-alpha.1" dependencies = [ "arrow", "connectorx", diff --git a/connectorx-cpp/Cargo.toml b/connectorx-cpp/Cargo.toml index 2573d5479..ae0c143e1 100644 --- a/connectorx-cpp/Cargo.toml +++ b/connectorx-cpp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "connectorx-cpp" -version = "0.3.2" +version = "0.3.3-alpha.1" edition = "2021" license = "MIT" diff --git a/connectorx-python/Cargo.lock b/connectorx-python/Cargo.lock index a8cd4337b..7b0284e13 100644 --- a/connectorx-python/Cargo.lock +++ b/connectorx-python/Cargo.lock @@ -897,7 +897,7 @@ dependencies = [ [[package]] name = "connectorx" -version = "0.3.2" +version = "0.3.3-alpha.1" dependencies = [ "anyhow", "arrow", @@ -947,7 +947,7 @@ dependencies = [ [[package]] name = "connectorx-python" -version = "0.3.2" +version = "0.3.3-alpha.1" dependencies = [ "anyhow", "arrow", @@ -3009,9 +3009,9 @@ dependencies = [ [[package]] name = "numpy" -version = "0.14.1" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c15af63aa0c74e0f7230d4e95d9a3d71a23449905f30f50b055df9a6a6a3e6" +checksum = "7f3a190dd1aa88ee0de91e59e970d5b85cfa079a9ff6531b69f811ccd0c2a6e1" dependencies = [ "cfg-if 0.1.10", "libc", @@ -3844,9 +3844,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35100f9347670a566a67aa623369293703322bb9db77d99d7df7313b575ae0c8" +checksum = "d41d50a7271e08c7c8a54cd24af5d62f73ee3a6f6a314215281ebdec421d5752" dependencies = [ "cfg-if 1.0.0", "indoc", @@ -3860,9 +3860,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d12961738cacbd7f91b7c43bc25cfeeaa2698ad07a04b3be0aa88b950865738f" +checksum = "779239fc40b8e18bc8416d3a37d280ca9b9fb04bda54b98037bb6748595c2410" dependencies = [ "once_cell", ] @@ -3875,9 +3875,9 @@ checksum = "be6d574e0f8cab2cdd1eeeb640cbf845c974519fa9e9b62fa9c08ecece0ca5de" [[package]] name = "pyo3-macros" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0bc5215d704824dfddddc03f93cb572e1155c68b6761c37005e1c288808ea8" +checksum = "00b247e8c664be87998d8628e86f282c25066165f1f8dda66100c48202fdb93a" dependencies = [ "pyo3-macros-backend", "quote", @@ -3886,9 +3886,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71623fc593224afaab918aa3afcaf86ed2f43d34f6afde7f3922608f253240df" +checksum = "5a8c2812c412e00e641d99eeb79dd478317d981d938aa60325dfa7157b607095" dependencies = [ "proc-macro2", "pyo3-build-config", diff --git a/connectorx-python/Cargo.toml b/connectorx-python/Cargo.toml index 20fd040cf..057bf1b02 100644 --- a/connectorx-python/Cargo.toml +++ b/connectorx-python/Cargo.toml @@ -2,7 +2,7 @@ authors = ["Weiyuan Wu "] edition = "2018" name = "connectorx-python" -version = "0.3.2" +version = "0.3.3-alpha.1" license = "MIT" readme = "README.md" @@ -27,12 +27,12 @@ lazy_static = "1.4.0" libc = "0.2" log = "0.4" ndarray = "0.15" -numpy = "0.14" +numpy = "0.15" openssl = {version = "0.10", features = ["vendored"]} postgres = {version = "0.19", features = ["with-chrono-0_4", "with-uuid-0_8", "with-serde_json-1"]} postgres-native-tls = {version = "0.5"} postgres-openssl = {version = "0.5.0"} -pyo3 = {version = "0.14", default-features = false, features = ["macros"]} +pyo3 = {version = "0.15", default-features = false, features = ["macros"]} pyo3-built = "0.4" rust_decimal = {version = "1", features = ["db-postgres"]} serde_json = "1" diff --git a/connectorx-python/pyproject.toml b/connectorx-python/pyproject.toml index 769144c46..aebc2f81c 100644 --- a/connectorx-python/pyproject.toml +++ b/connectorx-python/pyproject.toml @@ -18,12 +18,13 @@ license = "MIT" maintainers = ["Weiyuan Wu "] name = "connectorx" readme = "README.md" # Markdown files are supported -version = "0.3.2" +version = "0.3.3-alpha.1" [project] name = "connectorx" # Target file name of maturin build readme = "README.md" license = { text = "MIT" } +requires-python = ">=3.8" [tool.poetry.dependencies] dask = {version = "^2021", optional = true, extras = ["dataframe"]} diff --git a/connectorx-python/src/pandas/pandas_columns/array.rs b/connectorx-python/src/pandas/pandas_columns/array.rs index 3ef154361..f084a1a55 100644 --- a/connectorx-python/src/pandas/pandas_columns/array.rs +++ b/connectorx-python/src/pandas/pandas_columns/array.rs @@ -13,7 +13,7 @@ use std::marker::PhantomData; pub struct PyList(Py); // In order to put it into a numpy array -impl Element for PyList { +unsafe impl Element for PyList { const DATA_TYPE: numpy::DataType = numpy::DataType::Object; fn is_same_type(dtype: &PyArrayDescr) -> bool { unsafe { *dtype.as_dtype_ptr() }.type_num == NPY_TYPES::NPY_OBJECT as i32 diff --git a/connectorx-python/src/pandas/pandas_columns/boolean.rs b/connectorx-python/src/pandas/pandas_columns/boolean.rs index ec83e45b5..aab01a3e0 100644 --- a/connectorx-python/src/pandas/pandas_columns/boolean.rs +++ b/connectorx-python/src/pandas/pandas_columns/boolean.rs @@ -22,8 +22,8 @@ impl<'a> FromPyObject<'a> for BooleanBlock<'a> { } else { // if extension array let tuple = ob.downcast::()?; - let data = tuple.get_item(0); - let mask = tuple.get_item(1); + let data = tuple.get_item(0)?; + let mask = tuple.get_item(1)?; check_dtype(data, "bool")?; check_dtype(mask, "bool")?; diff --git a/connectorx-python/src/pandas/pandas_columns/bytes.rs b/connectorx-python/src/pandas/pandas_columns/bytes.rs index 51618d40d..6890df942 100644 --- a/connectorx-python/src/pandas/pandas_columns/bytes.rs +++ b/connectorx-python/src/pandas/pandas_columns/bytes.rs @@ -12,7 +12,7 @@ use std::any::TypeId; pub struct PyBytes(Py); // In order to put it into a numpy array -impl Element for PyBytes { +unsafe impl Element for PyBytes { const DATA_TYPE: numpy::DataType = numpy::DataType::Object; fn is_same_type(dtype: &PyArrayDescr) -> bool { unsafe { *dtype.as_dtype_ptr() }.type_num == NPY_TYPES::NPY_OBJECT as i32 diff --git a/connectorx-python/src/pandas/pandas_columns/int64.rs b/connectorx-python/src/pandas/pandas_columns/int64.rs index a9b0f13db..cfdbfd592 100644 --- a/connectorx-python/src/pandas/pandas_columns/int64.rs +++ b/connectorx-python/src/pandas/pandas_columns/int64.rs @@ -19,8 +19,8 @@ impl<'a> FromPyObject<'a> for Int64Block<'a> { Ok(Int64Block::NumPy(data)) } else { let tuple = ob.downcast::()?; - let data = tuple.get_item(0); - let mask = tuple.get_item(1); + let data = tuple.get_item(0)?; + let mask = tuple.get_item(1)?; check_dtype(data, "int64")?; check_dtype(mask, "bool")?; diff --git a/connectorx-python/src/pandas/pystring.rs b/connectorx-python/src/pandas/pystring.rs index 11709b1e2..84f39d581 100644 --- a/connectorx-python/src/pandas/pystring.rs +++ b/connectorx-python/src/pandas/pystring.rs @@ -8,7 +8,7 @@ use std::str::from_utf8_unchecked; pub struct PyString(Py); // In order to put it into a numpy array -impl Element for PyString { +unsafe impl Element for PyString { const DATA_TYPE: numpy::DataType = numpy::DataType::Object; fn is_same_type(dtype: &PyArrayDescr) -> bool { unsafe { *dtype.as_dtype_ptr() }.type_num == NPY_TYPES::NPY_OBJECT as i32 diff --git a/connectorx/Cargo.toml b/connectorx/Cargo.toml index f2060fe31..1077a0e4d 100644 --- a/connectorx/Cargo.toml +++ b/connectorx/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT" name = "connectorx" readme = "../README.md" repository = "https://github.com/sfu-db/connector-x" -version = "0.3.2" +version = "0.3.3-alpha.1" [dependencies] anyhow = "1"