-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[ML-Dataframe] Feature/dataframe basictests #32783
[ML-Dataframe] Feature/dataframe basictests #32783
Conversation
Pinging @elastic/ml-core |
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.
Some minor initial comments.
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(state); |
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.
#nit indentation
// to be replace by constant | ||
builder.field("id", id); | ||
{ | ||
builder.field(ID, id); | ||
} |
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.
Why are you keeping the scope if there is no longer a branch that prevents entry?
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 agree, took this over from another place and was wondering myself, but then thought:
As this builds a json object, it emulates the json structure. So this is rather syntactic sugar: forcing indentation to make the code more readable.
(Right now the whole config is bogus (empty). But this will be the next step.)
@@ -14,6 +14,8 @@ | |||
import org.elasticsearch.common.xcontent.XContentBuilder; | |||
import org.elasticsearch.common.xcontent.XContentParser; | |||
import org.elasticsearch.xpack.core.XPackPlugin; | |||
import org.elasticsearch.xpack.core.rollup.job.RollupJobConfig; |
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.
This is not used anywhere.
PARSER = new ConstructingObjectParser<>(NAME, false, (args, optionalId) -> { | ||
String id = args[0] != null ? (String) args[0] : optionalId; | ||
return new FeatureIndexBuilderJobConfig(id); | ||
}); |
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.
This does not necessarily need to be within a static initialization block.
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.
do not get this, can you elaborate?
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.
Usually, the static variable initialization is done outside of the static block.
Though this is not a strict pattern, I just don't see why you chose to initialize the value here instead of at the declaration.
|
||
private String id; | ||
private static final String NAME = "xpack/feature_index_builder/jobconfig"; | ||
private static final String ID = "id"; |
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.
Why did not remove this from being a ParseField
? This seems to go against the prevailing pattern.
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.
no strong feeling, I saw both versions in code
retest this please |
The remaining CI issues are due to the incomplete integration. Some classes need to be moved into X-Pack core, best to do this together with the planned naming changes and best to be done in a separate PR. |
Feature Index PR
this change enables testing as well as adds basic tests