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

[ML][Data Frame] Add version and create_time to transform config #43384

Merged

Conversation

benwtrent
Copy link
Member

@benwtrent benwtrent commented Jun 19, 2019

This adds two fields to the data frame transform config:

transform_version: indicates in which version of ES the transform was created
create_time: indicates the time at which the transform was create

Both are available in the response payloads, and are only added on PUT. Logic is in place to verify that the user cannot provide either of these fields on creation.

closes #43037

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

@@ -40,6 +44,8 @@
public static final ParseField SOURCE = new ParseField("source");
public static final ParseField DEST = new ParseField("dest");
public static final ParseField DESCRIPTION = new ParseField("description");
public static final ParseField TRANSFORM_VERSION = new ParseField("transform_version");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should call this just version. We went for job_version for anomaly detection jobs in hindsight it seems redundant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, I am fine with changing it.

@@ -48,6 +54,8 @@
private final DestConfig dest;
private final PivotConfig pivotConfig;
private final String description;
private final Version transformVersion;
private final Date createTime;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is new code, should we use the new java time classes (I guess Instant in this case)?

Copy link
Member Author

@benwtrent benwtrent Jun 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dimitris-athanasiou is this a thing? I did not know we should be using Instant instead of Date and that one supplanted the other. TIL.

Copy link
Contributor

@droberts195 droberts195 Jun 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, use Instant and serialize it using StreamOutput.writeInstant() and StreamInput.readInstant() (or StreamOutput.writeOptionalInstant() and StreamInput.readOptionalInstant() if more appropriate).

@benwtrent
Copy link
Member Author

run elasticsearch-ci/bwc
run elasticsearch-ci/default-distro

@benwtrent
Copy link
Member Author

@elasticmachine update branch

Copy link
Contributor

@dimitris-athanasiou dimitris-athanasiou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@benwtrent benwtrent merged commit ade8766 into elastic:master Jun 21, 2019
@benwtrent benwtrent deleted the feature/ml-df-add-transform-version branch June 21, 2019 11:47
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Jun 21, 2019
…stic#43384)

* [ML][Data Frame] Add version and create_time to transform config

* s/transform_version/version s/Date/Instant

* fixing getter/setter for version
benwtrent added a commit that referenced this pull request Jun 21, 2019
#43384) (#43480)

* [ML][Data Frame] Add version and create_time to transform config (#43384)

* [ML][Data Frame] Add version and create_time to transform config

* s/transform_version/version s/Date/Instant

* fixing getter/setter for version

* adjusting for backport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Add data frame create_time and version
5 participants