-
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
Refactoring scheduled event to store instant instead of zoned tme zone #39380
Refactoring scheduled event to store instant instead of zoned tme zone #39380
Conversation
Pinging @elastic/ml-core |
Jenkins retest this please |
@Mehrank64 Thank you so much for opening the PR 🚀 . Here are some gradle tasks to see if all the preCommit linting passes and the basic unit tests.
It looks like some linting failures are causing the builds to fail. |
@@ -27,7 +26,7 @@ | |||
public class ScheduledEventTests extends AbstractSerializingTestCase<ScheduledEvent> { | |||
|
|||
public static ScheduledEvent createScheduledEvent(String calendarId) { | |||
ZonedDateTime start = DateUtils.nowWithMillisResolution(); | |||
Instant start = Instant.ofEpochSecond(Instant.now().toEpochMilli()); |
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.
There's a discrepancy here - it's interpreting a millisecond number as seconds, resulting in a time long in the future.
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.
It was definitely a mistake. just solved!
Regarding the wildcard imports, which the style checker doesn't like, there is advice on how to stop IntelliJ switching to wildcards in https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md:
Hopefully if you change that setting and then re-save the files from IntelliJ it will remove the wildcard imports. |
|
@benwtrent I did resolve the linting failures and the now all the tests should pass. I closed the PR by accident and can't find any way to re-open it. will raise another PR. |
Jenkins retest this please |
Jenkins retest this please |
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.
LGTM
Thanks for the contribution @Mehrank64 - much appreciated!
The ScheduledEvent class has never preserved the time
zone so it makes more sense for it to store the start and
end time using Instant rather than ZonedDateTime.
Closes #38620