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

Tiny: Add InExpression argument check #19229

Merged
merged 1 commit into from
Dec 11, 2019
Merged

Tiny: Add InExpression argument check #19229

merged 1 commit into from
Dec 11, 2019

Conversation

roji
Copy link
Member

@roji roji commented Dec 8, 2019

Just to tighten things up, it's currently possible to construct in invalid InExpression via Update.

@smitpatel
Copy link
Contributor

I am not sure we need to add this validation as it is all provider code and highly unlikely to end up with both non-null unless typo or intentionally badly written code.

@roji
Copy link
Member Author

roji commented Dec 8, 2019

I am not sure we need to add this validation as it is all provider code and highly unlikely to end up with both non-null unless typo or intentionally badly written code.

I agree it's highly unlikely, it's just a validation check which also documents the invariant of this class. Is there any downside?

@smitpatel
Copy link
Contributor

Downside is maintenance. We have a lot of invariant in query pipeline, we don't have validation checks which throws exception for every one of them. We could add those but cost of maintaining them/updating them if anything changes is high compared value it provides.

@roji
Copy link
Member Author

roji commented Dec 9, 2019

I'm not saying we should start a systematic search of all unexpressed invariants or anything. This is just something I came across which doesn't cost anything to do and improves correctness/readability a bit. We can do these opportunistically as we come across them (like I did here). I don't think this single correctness check adds any burden of maintenance.

@smitpatel
Copy link
Contributor

Blocked on #19233

@roji roji force-pushed the InExpressionCheck branch from 313983d to 4f092a7 Compare December 9, 2019 23:22
@roji
Copy link
Member Author

roji commented Dec 9, 2019

@smitpatel moved the check from the constructor to Update as requested.

@roji roji merged commit 7453f1e into master Dec 11, 2019
@roji roji deleted the InExpressionCheck branch December 11, 2019 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants