Skip to content

Commit dcebc1b

Browse files
committed
Renamed argument "params" of query_extended() to "data_binding"
Released as new version 4.2.0 Upgraded neo4j library to 4.4.11
1 parent 38fb4af commit dcebc1b

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "neoaccess"
7-
version = "4.1.0"
7+
version = "4.2.0"
88
authors = [
99
{ name = "Julian West BrainAnnex.org" },
1010
]
@@ -21,7 +21,7 @@ classifiers = [
2121
"Operating System :: OS Independent",
2222
]
2323
dependencies = [
24-
"neo4j==4.3.9",
24+
"neo4j==4.4.11",
2525
"numpy~=1.22.4",
2626
"pandas~=1.4.3",
2727
]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
neo4j==4.3.9
1+
neo4j==4.4.11
22
numpy==1.22.4
33
pandas==1.4.3
44

src/neoaccess/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = "4.2.0" # IN_PROGRESS
1+
__version__ = "4.2.0"
22

33
from .neoaccess import NeoAccess

src/neoaccess/neoaccess.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ def query(self, q: str, data_binding=None, single_row=False, single_cell="", sin
315315

316316

317317

318-
def query_extended(self, q: str, params = None, flatten = False, fields_to_exclude = None) -> [dict]:
319-
""" # TODO: rename params to data_binding
318+
def query_extended(self, q: str, data_binding = None, flatten = False, fields_to_exclude = None) -> [dict]:
319+
"""
320320
Extended version of query(), meant to extract additional info
321321
for queries that return Graph Data Types,
322322
i.e. nodes, relationships or paths,
@@ -336,7 +336,7 @@ def query_extended(self, q: str, params = None, flatten = False, fields_to_exclu
336336
Try running with flatten=True "MATCH (b:boat), (c:car) RETURN b, c" on data like "CREATE (b:boat), (c1:car1), (c2:car2)"
337337
338338
:param q: A Cypher query
339-
:param params: An optional Cypher dictionary
339+
:param data_binding: An optional Cypher dictionary
340340
EXAMPLE, assuming that the cypher string contains the substring "$age":
341341
{'age': 20}
342342
:param flatten: Flag indicating whether the Graph Data Types need to remain clustered by record,
@@ -358,9 +358,9 @@ def query_extended(self, q: str, params = None, flatten = False, fields_to_exclu
358358
"""
359359
# Start a new session, use it, and then immediately close it
360360
with self.driver.session() as new_session:
361-
result = new_session.run(q, params)
361+
result = new_session.run(q, data_binding)
362362
if self.profiling:
363-
print("-- query_extended() PROFILING ----------\n", q, "\n", params)
363+
print("-- query_extended() PROFILING ----------\n", q, "\n", data_binding)
364364

365365
# Note: A neo4j.Result iterable object (printing it, shows an object of type "neo4j.work.result.Result")
366366
# See https://neo4j.com/docs/api/python-driver/current/api.html#neo4j.Result
@@ -2213,7 +2213,7 @@ def get_siblings(self, internal_id: int, rel_name: str, rel_dir="OUT") -> [int]:
22132213
raise Exception(f"get_siblings(): unknown value for the `rel_dir` argument ({rel_dir}); "
22142214
f"allowed values are 'IN' and 'OUT'")
22152215

2216-
result = self.query_extended(q, params={"internal_id": internal_id}, flatten=True)
2216+
result = self.query_extended(q, data_binding={"internal_id": internal_id}, flatten=True)
22172217
return result
22182218

22192219

@@ -2258,9 +2258,9 @@ def get_label_properties(self, label:str) -> list:
22582258
RETURN DISTINCT propertyName
22592259
ORDER BY propertyName
22602260
"""
2261-
params = {'label': label}
2261+
data_binding = {'label': label}
22622262

2263-
return [res['propertyName'] for res in self.query(q, params)]
2263+
return [res['propertyName'] for res in self.query(q, data_binding)]
22642264

22652265

22662266

tests/test_neoaccess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_construction():
3838
obj1 = neo_access.NeoAccess(url, debug=False) # Rely on default username/pass
3939

4040
assert obj1.debug is False
41-
assert obj1.version() == "4.3.9" # Test the version of the Neo4j driver (this ought to match the value in requirements.txt)
41+
assert obj1.version() == "4.4.11" # Test the version of the Neo4j driver (this ought to match the value in requirements.txt)
4242

4343

4444
# Another way of instantiating the class

0 commit comments

Comments
 (0)