-
Notifications
You must be signed in to change notification settings - Fork 28
patching command framework infrahub db patch plan/apply/revert
#6311
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
Changes from 1 commit
eee2ad7
3c12ffa
3d18abc
a69972a
1e25251
7e66f61
6da34db
5fb73e3
87632ad
b27d48c
f00e74f
7300e4a
d4884a9
fc01260
57e0669
35dee9e
c4b3db0
6261a39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ async def _run_add_query(self, labels: list[str], vertices_to_add: list[VertexTo | |
"cypher_variable_map": cypher_variable_map, | ||
"id_func_name": self.db.get_id_function_name(), | ||
} | ||
results, _ = await self.db.execute_query_with_metadata( | ||
results = await self.db.execute_query( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this query is executed with 100 vertices to add, if for some reason it fails while only 60 vertices were created, would this function raise an error, implying these 60 created vertices ids would not later be added to the list of created vertices? If so, running this query in a transaction that would be rollback in case of failure would fix this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. very good question. thanks for reading through and really understanding what is going on here. I think that you are right and a transaction will be helpful here, so I've added it (and in the same place in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the transaction commit fails, my understanding is that an error would be raised so nothing would be written to the file? |
||
query=query, params={"vertices_to_add": serial_vertices_to_add}, type=QueryType.WRITE | ||
) | ||
abstract_to_concrete_id_map: dict[str, str] = {} | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
list comprehension could be used here, and on similar patterns below
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.
good suggestion. I've made the change and it is more readable this way