-
Notifications
You must be signed in to change notification settings - Fork 340
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 #1289 EC2 get_images_in_use() failed with CypherSyntaxError when using Neo4J 5.16.0 #1290
Conversation
e2db9be
to
4d88e22
Compare
…yntaxError when using Neo4J 5.16.0
4d88e22
to
34b5d63
Compare
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.
Thank you for taking this on and very much appreciate the fix! Sorry for the lateness in this review
WHERE ltv.region = $Region | ||
WITH collect(DISTINCT ltv.image_id)+images AS images | ||
RETURN images |
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.
To make sure I understand
(comment 1) If I understand correctly, this originally returns a list of image ids in a field called images
.
WHERE ltv.region = $Region | ||
WITH collect(DISTINCT ltv.image_id)+images AS images | ||
RETURN images | ||
RETURN DISTINCT(ltv.image_id) as image |
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.
(comment 2) .. and this new code returns a list of image id strings without needing to put it in a field of any sort
""" | ||
results = neo4j_session.run(get_images_query, AWS_ACCOUNT_ID=current_aws_account_id, Region=region) | ||
images = [] | ||
for r in results: | ||
images.extend(r['images']) | ||
images.append(r['image']) |
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.
(comment 3) and because of that we can simply append to the existing array instead of extend
…yntaxError when using Neo4J 5.16.0 (cartography-cncf#1290)
No description provided.