Skip to content

Fixed bug in dropping Generalization #3668

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

Merged
merged 3 commits into from
Dec 17, 2024
Merged

Conversation

pbrown12303
Copy link
Contributor

The logic for drop assumed that the relationship would have a multiplicity of many (>1) at both ends. Generalization has an upper bound of 1 on each end. Added logic to drop to handle the case when the upper bound is 1.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the python Pull requests that update Python code label Dec 16, 2024
@amolenaar
Copy link
Member

amolenaar commented Dec 17, 2024

Thanks @pbrown12303.

I ran into another issue: drop() is expected to return only a single presentation, so the items were not selected, but instead an exception was raised. I fixed the method to return on the first match. Also added (and fixed) some type annotations.

@amolenaar amolenaar merged commit e8164fe into gaphor:main Dec 17, 2024
23 checks passed
@amolenaar amolenaar added the fix A fix for a bug label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants