Skip to content
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

Refactor AttributeAddQuery to support node with an attribute of the same name previously active #4742

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

dgarros
Copy link
Collaborator

@dgarros dgarros commented Oct 25, 2024

Fixes #4727

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Oct 25, 2024
Copy link
Contributor

@ajtmccarty ajtmccarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few small comments

MATCH path1 = (root:Root)<-[r1:IS_PART_OF]-(n)
OPTIONAL MATCH path2 = (n)-[r2:HAS_ATTRIBUTE]-(:Attribute { name: $attr_name })
WHERE all(r IN relationships(path1) WHERE (%(branch_filter)s))
AND all(r IN relationships(path2) WHERE (%(branch_filter)s))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WHERE all(r in [r1, r2] WHERE (%(branch_filter)s))

WITH n1 as n, r1 as rb
WHERE rb.status = "active"
WITH n1 as n, r11 as r1, r12 as r2
WHERE (r1.status = "active" and r2 is null) OR (r1.status = "active" and r2.status = "deleted")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WHERE r1.status = "active" AND (r2 IS NULL OR r2.status = "deleted")

)
assert len(persons) == 1
john = persons[0]
john.height.value = 200
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add an assert that the value is None before updating it to check that John's initial height was deleted

assert query.get_nbr_migrations_executed() == 2

# ------------------------------------------
# Delete the attribute Color
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the attribute color

@dgarros dgarros marked this pull request as ready for review October 25, 2024 17:16
@dgarros dgarros added the type/bug Something isn't working as expected label Oct 25, 2024
@dgarros dgarros merged commit 2fbadce into release-1.0 Oct 25, 2024
34 checks passed
@dgarros dgarros deleted the dga-20241025-fix-4727 branch October 25, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants