-
Notifications
You must be signed in to change notification settings - Fork 5
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 test_db.py failure caused by gaia_ptr_t refactoring #1139
Conversation
@@ -3,36 +3,36 @@ | |||
# All rights reserved. | |||
############################################# | |||
|
|||
from gaia_db_pybind import *; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python a bit rusty eh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
production/db/core/src/dump_se.py
Outdated
type = 1; | ||
done = False; | ||
type = 1 | ||
done = False | ||
while not(done): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while not done:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
print("Iterating through nodes of type: " + str(type) + "..."); | ||
node_iter = gaia_ptr.find_first(type); | ||
print("Iterating through nodes of type: " + str(type) + "...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personally, I would use f-strings if you are comfortable with them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can;t compile/run this thing locally so I would refrain from that. (otherwise I would)
production/db/core/src/dump_se.py
Outdated
print("Iterating through nodes of type: " + str(type) + "..."); | ||
node_iter = gaia_ptr.find_first(type); | ||
print("Iterating through nodes of type: " + str(type) + "...") | ||
node_iter = gaia_ptr.find_first(type) | ||
|
||
if (node_iter.is_null() == True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if node_iter.is_null():
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
production/db/core/src/dump_se.py
Outdated
print("No nodes of type " + str(type) + " were found!"); | ||
no_node = True; | ||
print("No nodes of type " + str(type) + " were found!") | ||
no_node = True | ||
|
||
while node_iter.is_null() != True: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
|
||
type = type + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type += 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, I would say that we should use one of my lint.sh scripts on this, but it may be overkill.
It is not great Python, but should work fine.
gaia_ptr_t::open
togaia_ptr_t::from-gaia_id()
;
Note: I haven't been able to build the python stuff on my machine for a while. Running a CI build to see if this is actually working: