Skip to content

Improved UX of creating TimestampNanosecondArray with timezones #3042

@alamb

Description

@alamb

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

Metadata

Metadata

Assignees

Labels

arrowChanges to the arrow crateenhancementAny new improvement worthy of a entry in the changeloggood first issueGood for newcomers

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions