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

Handle the timezone in extract week in temporal.rs #1380

Closed
Tracked by #3148
Ted-Jiang opened this issue Mar 2, 2022 · 1 comment · Fixed by #3218
Closed
Tracked by #3148

Handle the timezone in extract week in temporal.rs #1380

Ted-Jiang opened this issue Mar 2, 2022 · 1 comment · Fixed by #3218
Labels
enhancement Any new improvement worthy of a entry in the changelog

Comments

@Ted-Jiang
Copy link
Member

Ted-Jiang commented Mar 2, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

/// Extracts the week of a given temporal array as an array of integers
pub fn week<T>(array: &PrimitiveArray<T>) -> Result<Int32Array>
where
    T: ArrowTemporalType + ArrowNumericType,
    i64: std::convert::From<T::Native>,
{
    let mut b = Int32Builder::new(array.len());

    match array.data_type() {
        &DataType::Date32 | &DataType::Date64 | &DataType::Timestamp(_, None) => {
            extract_component_from_array!(array, b, iso_week, week, value_as_datetime)
        }
        dt => return_compute_error_with!("week does not support", dt),
    }

    Ok(b.finish())
}

Now week not support Timestamp with timezone.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@waitingkuo
Copy link
Contributor

@Ted-Jiang i think this is solved in some pr. i added a test case to close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants