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

Core: Deprecate negative epoch timestamps #36793

Merged
merged 9 commits into from Dec 20, 2018
Merged

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Dec 18, 2018

Negative timestamps are currently supported in joda time. These are
dates before epoch. However, it doesn't really make sense to have a
negative timestamp, since this is a modern format. Any dates before
epoch can be represented with normal date formats, like ISO8601.
Additionally, implementing negative epoch timestamp parsing in java time
has an edge case which would more than double the code required. This
commit deprecates use of negative epoch timestamps.

Negative timestamps are currently supported in joda time. These are
dates before epoch. However, it doesn't really make sense to have a
negative timestamp, since this is a modern format. Any dates before
epoch can be represented with normal date formats, like ISO8601.
Additionally, implementing negative epoch timestamp parsing in java time
has an edge case which would more than double the code required. This
commit deprecates use of negative epoch timestamps.
@rjernst rjernst added :Core/Infra/Core Core issues without another label >deprecation v7.0.0 v6.6.0 labels Dec 18, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

I left a question.

@@ -262,49 +262,6 @@ public void testThatEpochsCanBeParsed() {
assertThat(formatter.parseJoda(epochFloatValue).getMillis(), is(dateTime.getMillis()));
}

public void testThatNegativeEpochsCanBeParsed() {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this test removed? These would still be parsed by Joda, so would issue deprecation warnings? Or am I misunderstanding something?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added it back with a warning check in efd290b

@rjernst
Copy link
Member Author

rjernst commented Dec 18, 2018

@elasticmachine test this please

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

LGTM.

@rjernst
Copy link
Member Author

rjernst commented Dec 18, 2018

@elasticmachine test this please

@jasontedor jasontedor added v6.7.0 and removed v6.6.0 labels Dec 19, 2018
@rjernst rjernst merged commit cfc0a47 into elastic:master Dec 20, 2018
@rjernst rjernst deleted the timeapi23 branch December 20, 2018 08:17
rjernst added a commit that referenced this pull request Dec 20, 2018
Negative timestamps are currently supported in joda time. These are
dates before epoch. However, it doesn't really make sense to have a
negative timestamp, since this is a modern format. Any dates before
epoch can be represented with normal date formats, like ISO8601.
Additionally, implementing negative epoch timestamp parsing in java time
has an edge case which would more than double the code required. This
commit deprecates use of negative epoch timestamps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants