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

Improved UX of creating TimestampNanosecondArray with timezones #3042

Closed
alamb opened this issue Nov 7, 2022 · 3 comments · Fixed by #3088
Closed

Improved UX of creating TimestampNanosecondArray with timezones #3042

alamb opened this issue Nov 7, 2022 · 3 comments · Fixed by #3088
Assignees
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers

Comments

@alamb
Copy link
Contributor

alamb commented Nov 7, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
While working on apache/datafusion#4039 and https://github.com/influxdata/influxdb_iox/pull/6061 I ended up having to do this many times:

Arc::new(TimestampNanosecondArray::from(vec![...],)
  .with_timezone("+0:00".into())

While this API is already nicer than previously, there are two more improvements that might help:

Describe the solution you'd like
Allow passing &str as well as String to with_timezone:

Arc::new(TimestampNanosecondArray::from(vec![...],)
  .with_timezone("+0:00")

Add an alias for UTC:

Arc::new(TimestampNanosecondArray::from(vec![...],)
  .with_timezone_utc()

Describe alternatives you've considered

Additional context
cc @waitingkuo who is actively working to improve the timezone situation in arrow / datafusion ❤️

I think this is a good first issue as the code and tests are already there, all that is needed is a signature change (from String to impl Into<String>) and some tests

@alamb alamb added good first issue Good for newcomers arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog labels Nov 7, 2022
@waitingkuo
Copy link
Contributor

i'll take it if there's no one take it this week or next.
if there's anyone interested in, i happy to point out the codes to modify

@src255
Copy link
Contributor

src255 commented Nov 8, 2022

@waitingkuo I can help with this. Which file(s) should I modify?

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

Successfully merging a pull request may close this issue.

3 participants