This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
fix(#1489): Fix equal to offset for whitelist #1571
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Partial fix for the ticket #1489. This fixes the equal to case, but doesn't address the before or after cases. The reason for a partial fix is due to the difficulty comparing the two different cases (equal vs before/after). Equal to is simple because all of the values can be adjusted by the offset, translating a set of values to a set of values. Before/after are more complicated, as theoretically each of the values must be translated to a range. This therefore means the result is a set of restrictions. Unfortunately, the system isn't designed to be passing around a set of restrictions at this time in the program. Therefore, this will take further thought. A possible solution is to take the most restrictive of the values. This would ensure that whichever values are picked are permissable, but would severely limit the number of values output.
Tom-hayden
suggested changes
Dec 2, 2019
...java/com/scottlogic/datahelix/generator/core/fieldspecs/relations/EqualToOffsetRelation.java
Outdated
Show resolved
Hide resolved
caba76e
to
8c9ce17
Compare
329df21
to
bc6580c
Compare
Tom-hayden
approved these changes
Dec 3, 2019
Partial fix for the ticket #1489. This fixes the equal to case, but doesn't address the before or after cases. The reason for a partial fix is due to the difficulty comparing the two different cases (equal vs before/after). Equal to is simple because all of the values can be adjusted by the offset, translating a set of values to a set of values. Before/after are more complicated, as theoretically each of the values must be translated to a range. This therefore means the result is a set of restrictions. Unfortunately, the system isn't designed to be passing around a set of restrictions at this time in the program. Therefore, this will take further thought. A possible solution is to take the most restrictive of the values. This would ensure that whichever values are picked are permissable, but would severely limit the number of values output.
bc6580c
to
c4909b8
Compare
return FieldSpecFactory.nullOnly(); | ||
} | ||
if (otherFieldSpec instanceof WhitelistFieldSpec) { | ||
throw new UnsupportedOperationException("cannot combine sets with equal to offset relation, Issue #1489"); |
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'm shocked this wasn't working before 😄
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Partial fix for the ticket #1489. This fixes the equal to case, but
doesn't address the before or after cases.
The reason for a partial fix is due to the difficulty comparing the two
different cases (equal vs before/after).
Equal to is simple because all of the values can be adjusted by the
offset, translating a set of values to a set of values.
Before/after are more complicated, as theoretically each of the values
must be translated to a range. This therefore means the result is a set
of restrictions. Unfortunately, the system isn't designed to be passing
around a set of restrictions at this time in the program. Therefore,
this will take further thought.
A possible solution is to take the most restrictive of the values. This
would ensure that whichever values are picked are permissable, but would
severely limit the number of values output.
Issue
Related to #1489