-
Notifications
You must be signed in to change notification settings - Fork 0
Scan plan model parser cleanup responses #4
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
Scan plan model parser cleanup responses #4
Conversation
| return JsonUtil.parse(json, FetchPlanningResultResponseParser::fromJson); | ||
| } | ||
|
|
||
| @SuppressWarnings("checkstyle:CyclomaticComplexity") |
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.
Should be able to remove this now
| return JsonUtil.generate(gen -> toJson(response, gen), pretty); | ||
| } | ||
|
|
||
| @SuppressWarnings("checkstyle:CyclomaticComplexity") |
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.
Should be able to remove this now
| public void validate() { | ||
| Preconditions.checkArgument(planStatus() != null, "Invalid status: null"); | ||
| Preconditions.checkArgument( | ||
| planStatus() == PlanStatus.COMPLETED || (planTasks() == null && fileScanTasks() == null), |
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.
nvm I think this is working at-least from the tests standpoint
| return JsonUtil.parse(json, FetchPlanningResultResponseParser::fromJson); | ||
| } | ||
|
|
||
| @SuppressWarnings("checkstyle:CyclomaticComplexity") |
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 think we can remove this now since we dont have so many conditionals in the method.
| return JsonUtil.generate(gen -> toJson(response, gen), pretty); | ||
| } | ||
|
|
||
| @SuppressWarnings("checkstyle:CyclomaticComplexity") |
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.
We can try also removing this here now, and see if check style passes without this.
1be1afa to
1962844
Compare
| planStatus() != PlanStatus.CANCELLED, | ||
| "Invalid response: 'cancelled' is not a valid status for planTableScan"); | ||
| Preconditions.checkArgument( | ||
| planStatus() == PlanStatus.COMPLETED || (planTasks() == null && fileScanTasks() == null), |
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 think we need one more case where if completed we must return tasks.
Cleaning up some responses