Skip to content

Commit b3540b7

Browse files
authored
Remove logger from Database (#3270)
1 parent ae3dc88 commit b3540b7

3 files changed

Lines changed: 21 additions & 39 deletions

File tree

src_cpp/include/py_database.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ class PyDatabase {
1111
friend class PyConnection;
1212

1313
public:
14-
inline void setLoggingLevel(std::string logging_level) {
15-
database->setLoggingLevel(std::move(logging_level));
16-
}
17-
1814
static void initialize(py::handle& m);
1915

2016
static py::str getVersion();

src_cpp/py_database.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ void PyDatabase::initialize(py::handle& m) {
1515
py::arg("database_path"), py::arg("buffer_pool_size") = 0,
1616
py::arg("max_num_threads") = 0, py::arg("compression") = true,
1717
py::arg("read_only") = false, py::arg("max_db_size") = (uint64_t)1 << 43)
18-
.def("set_logging_level", &PyDatabase::setLoggingLevel, py::arg("logging_level"))
1918
.def("scan_node_table_as_int64", &PyDatabase::scanNodeTable<std::int64_t>,
2019
py::arg("table_name"), py::arg("prop_name"), py::arg("indices"), py::arg("np_array"),
2120
py::arg("num_threads"))

src_py/database.py

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ class Database:
2626
"""Kùzu database instance."""
2727

2828
def __init__(
29-
self,
30-
database_path: str | Path,
31-
*,
32-
buffer_pool_size: int = 0,
33-
max_num_threads: int = 0,
34-
compression: bool = True,
35-
lazy_init: bool = False,
36-
read_only: bool = False,
37-
max_db_size: int = (1 << 43),
29+
self,
30+
database_path: str | Path,
31+
*,
32+
buffer_pool_size: int = 0,
33+
max_num_threads: int = 0,
34+
compression: bool = True,
35+
lazy_init: bool = False,
36+
read_only: bool = False,
37+
max_db_size: int = (1 << 43),
3838
):
3939
"""
4040
Parameters
@@ -92,10 +92,10 @@ def __enter__(self) -> Self:
9292
return self
9393

9494
def __exit__(
95-
self,
96-
exc_type: type[BaseException] | None,
97-
exc_value: BaseException | None,
98-
exc_traceback: TracebackType | None,
95+
self,
96+
exc_type: type[BaseException] | None,
97+
exc_value: BaseException | None,
98+
exc_traceback: TracebackType | None,
9999
) -> None:
100100
self.close()
101101

@@ -146,21 +146,8 @@ def init_database(self) -> None:
146146
self.max_db_size,
147147
)
148148

149-
def set_logging_level(self, level: str) -> None:
150-
"""
151-
Set the logging level.
152-
153-
Parameters
154-
----------
155-
level : str
156-
Logging level. One of "debug", "info", "err".
157-
158-
"""
159-
self.check_for_database_close()
160-
self._database.set_logging_level(level)
161-
162149
def get_torch_geometric_remote_backend(
163-
self, num_threads: int | None = None
150+
self, num_threads: int | None = None
164151
) -> tuple[KuzuFeatureStore, KuzuGraphStore]:
165152
"""
166153
Use the database as the remote backend for torch_geometric.
@@ -213,13 +200,13 @@ def get_torch_geometric_remote_backend(
213200
)
214201

215202
def _scan_node_table(
216-
self,
217-
table_name: str,
218-
prop_name: str,
219-
prop_type: str,
220-
dim: int,
221-
indices: IndexType,
222-
num_threads: int,
203+
self,
204+
table_name: str,
205+
prop_name: str,
206+
prop_type: str,
207+
dim: int,
208+
indices: IndexType,
209+
num_threads: int,
223210
) -> NDArray[Any]:
224211
self.check_for_database_close()
225212
import numpy as np

0 commit comments

Comments
 (0)