-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Refactor marker in Neo4jStalenessRemovalTask #297
Conversation
Codecov Report
@@ Coverage Diff @@
## master #297 +/- ##
==========================================
+ Coverage 73.45% 73.57% +0.12%
==========================================
Files 103 103
Lines 4328 4329 +1
Branches 403 403
==========================================
+ Hits 3179 3185 +6
+ Misses 1049 1044 -5
Partials 100 100
Continue to review full report at Codecov.
|
c0574fd
to
1496dd6
Compare
hey @jinhyukchang could you take a look at this pr? thanks. |
@otakart Could you elaborate what you meant by "Arbitrary expressions as parameters are not supported by neo4j."? This is working in our Neo4j version "3.3.5", but I wonder if it's not working for you. |
Hi @jinhyukchang , According to neo4j documentation https://neo4j.com/docs/cypher-manual/3.5/syntax/parameters/ from neo4j import GraphDatabase
host = '***'
user = '***'
pw = '***'
driver = GraphDatabase.driver(host, auth=(user, pw))
with driver.session() as session:
res = session.run('return $param as result', param='timestamp() - 123')
print(res.single()) the output is:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Hi @jinhyukchang please let me know if you need any additional information. Thanks |
ping @jinhyukchang |
@otakart if you update the pr, I will take a look and merge it given @jinhyukchang is not available. Sorry for the wait |
Summary of Changes
When
milliseconds_to_expire
is used to identify stale data,Neo4jStalenessRemovalTask
passesmarker
with expression(timestamp() - {}).format(milliseconds_to_expire)
as parameter to neo4j. Arbitrary expressions as parameters are not supported by neo4j.This PR gets
timestamp()
value from neo4j and calculatesmarker
as integer.Tests
Modified
tests/unit/task/test_neo4j_staleness_removal_task.py
.CheckList
Make sure you have checked all steps below to ensure a timely review.
make test