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

Use weekyear for consistency #60707

Closed
wants to merge 1 commit into from
Closed

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Aug 5, 2020

Relates: #60044 and #59555 (review)

With the removal of camel case format names,
the format name for WEEK_YEAR has been set
to "week_year", but this is inconsistent with the usage
in other formats related to weekyear e.g.

WEEKYEAR_WEEK("weekyear_week"),
WEEKYEAR_WEEK_DAY("weekyear_week_day"),

This PR

  • replaces the snakecase format "week_year" with "weekyear"
  • renames enum constants from WEEK_YEAR to WEEKYEAR for consistency
    with other constants related to weekyear.

I can open another PR to address the deprecation change in 7.x/7.9 related to #59555

Relates: elastic#60044 and elastic#59555 (review)

With the removal of camel case format names,
the format name for `WEEK_YEAR` has been set
to `week_year`, but this is inconsistent with the usage
in other formats related to weekyear e.g.

```
WEEKYEAR_WEEK("weekyear_week"),
WEEKYEAR_WEEK_DAY("weekyear_week_day"),
```

This commit

- replaces the snakecase format `week_year` with `weekyear`
- renames enum constants from `WEEK_YEAR` to `WEEKYEAR` for consistency
  with other constants related to weekyear.
@russcam russcam requested a review from rjernst August 5, 2020 06:10
Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

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

LGTM but would love @pgomulka to confirm.

russcam added a commit to russcam/elasticsearch that referenced this pull request Aug 7, 2020
Relates: elastic#60707

With the deprecation of camel case names in elastic#59555,
the format "weekyear" was deprecated in favour of
"week_year". This is inconsistent with other weekyear
formats however, that use "weekyear", for example

```
WEEKYEAR_WEEK("weekyear_week"),
WEEKYEAR_WEEK_DAY("weekyear_week_day"),
```

This commit keeps "weekyear" as the snake case name
for the enum constant FormatNames.WEEK_YEAR. In addition,
the format for DateFormatter WEEK_YEAR is changed to
"weekyear".
@rjernst
Copy link
Member

rjernst commented Aug 13, 2020

This looks fine, but we should first have a PR to add the deprecation. It should go through the master branch first, and be backported, then this change can apply to master only.

Copy link
Contributor

@pgomulka pgomulka left a comment

Choose a reason for hiding this comment

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

it looks good to me, but I wonder if we should add a WEEKYEAR in 7.x, deprecate WEEK_YEAR in 7.x and remove WEEK_YEAR in master?
#60855 (review)

pgomulka added a commit to pgomulka/elasticsearch that referenced this pull request Oct 6, 2020
week_year is misleading as the formatter only has a weekyear. A field
corresponsing to 'Y'. 'weekyear' should be used instead

relates elastic#60707
pgomulka added a commit to pgomulka/elasticsearch that referenced this pull request Oct 6, 2020
week_year is misleading as the formatter only has a weekyear. A field
corresponsing to 'Y'. 'weekyear' should be used instead

relates elastic#60707
pgomulka added a commit that referenced this pull request Oct 7, 2020
week_year is misleading as the formatter only has a weekyear. A field
corresponding to 'Y'. 'weekyear' should be used instead

relates #60707
pgomulka added a commit that referenced this pull request Oct 7, 2020
…#63308)

week_year is misleading as the formatter only has a weekyear. A field
corresponding to 'Y'. 'weekyear' should be used instead

relates #60707
backports #63307
pgomulka added a commit to pgomulka/elasticsearch that referenced this pull request Oct 7, 2020
week_year is replaced by weekyear. This is a single field YYYY date
format.

relates elastic#60707
@pgomulka
Copy link
Contributor

pgomulka commented Oct 7, 2020

closing in favour of #63384

@pgomulka pgomulka closed this Oct 7, 2020
pgomulka added a commit that referenced this pull request Oct 12, 2020
week_year is replaced by weekyear. This is a single field YYYY date
format.
follow up after a deprecation #63307
relates #60707
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants