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

GH-37288: [MATLAB] Add an arrow.internal.validate.temporal.dateUnit helper function #37289

Closed
wants to merge 1 commit into from

Conversation

kevingurney
Copy link
Member

@kevingurney kevingurney commented Aug 21, 2023

Rationale for this change

To mirror the arrow.internal.validate.temporal.timeUnit helper function added in #37250, this pull request adds an arrow.internal.validate.temporal.dateUnit helper function.

This helper function can be used to simplify the implementation of arrow.type.Date32Type and arrow.type.Date64Type.

What changes are included in this PR?

  1. Added a new helper function arrow.internal.validate.temporal.dateUnit.

  2. Updated comments and variable names in arrow.internal.validate.temporal.timeUnit for consistency with arrow.internal.validate.temporal.dateUnit and to reflect planned changes to Arrow type class hierarchy:

    • TimeType and DateType inherit from TemporalType
    • Time32Type and Time64Type inherit from TimeType
    • Date32Type and Date64Type inherit from DateType

Are these changes tested?

Yes.

  1. Added new test class tDateUnit.
  2. Updated existing test class tTimeUnit for consistency with new tDateUnit test class.

Are there any user-facing changes?

No.

arrow.internal.validate.temporal.dateUnit is an internal helper function.

2. Add new test class tDateUnit.
3. Update test class tTimeUnit for consistency.
@github-actions
Copy link

⚠️ GitHub issue #37288 has been automatically assigned in GitHub to PR creator.

@kevingurney
Copy link
Member Author

After thinking this through, we realized that we actually don't need this helper function for Date types because there won't be any DateUnit name-value pair on the arrow.date32 or arrow.date64 functions. Unlike Time32Type and Time64Type, which can have different TimeUnit values, the DateUnit for Date32Type and Date64Type will always be fixed to Day and Millisecond, respectively.

I will close this PR and the associated issue #37288.

My apologies for the confusion.

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.

[MATLAB] Add an arrow.internal.validate.temporal.dateUnit helper function
1 participant