Skip to content

[BUG] Fix DateTimeFunctionTest. testWeekOfYearWithTimeType() YearweekTest. testYearweekWithTimeType() Unit tests. #2477

Closed

Description

@vamsimanohar

What is the bug?

  • DateTimeFunctionTest. testWeekOfYearWithTimeType() YearweekTest. testYearweekWithTimeType() unit tests are temporarily fixed in this PR here : Temporary fixes for build errors #2476.
  • The ask from this bug is to come up with a proper fix for it.

Issue details: Jan 2024 starts with Monday and we calculate weekoftheyear using SUNDAY as the firstdayoftheweek this makes 22nd Jan 3rd week of the year rather 4th week.

We can consider moving to LocalDateTime instead of Calendar.

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

What is the expected behavior?
A clear and concise description of what you expected to happen.

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • Plugins

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?
Add any other context about the problem.

Activity

  1. added
    bug
    on Jan 25, 2024
  2. kenrickyap commented on Jan 8, 2025

    @kenrickyap
    Contributor

    am currently looking these test failures

  3. acarbonetto commented on Feb 4, 2025

    @acarbonetto
    Collaborator

    Reopened due to current CI test failures: https://github.com/opensearch-project/sql/actions/runs/13124882810/job/36619055365

    ExtractTest > testExtractDatePartWithTimeType() FAILED
        org.opentest4j.AssertionFailedError: expected: <5> but was: <6>
            at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
            at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
            at app//org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
            at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
            at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
            at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:635)
            at app//org.opensearch.sql.expression.datetime.ExtractTest.datePartWithTimeArgQuery(ExtractTest.java:90)
            at app//org.opensearch.sql.expression.datetime.ExtractTest.testExtractDatePartWithTimeType(ExtractTest.java:106)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions