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

Debug format for timestamp ignores timezone #3069

Closed
tustvold opened this issue Nov 9, 2022 · 4 comments
Closed

Debug format for timestamp ignores timezone #3069

tustvold opened this issue Nov 9, 2022 · 4 comments
Labels
arrow Changes to the arrow crate bug

Comments

@tustvold
Copy link
Contributor

tustvold commented Nov 9, 2022

Describe the bug

The Debug implementation for PrimitiveArray ignores the timestamp of timestamp arrays.

To Reproduce

let a = TimestampSecondArray::from(vec![Some(86405), Some(1), None])
     .with_timezone("+01:00".to_string());

    println!("{:?}", a);

Returns

PrimitiveArray<Timestamp(Second, Some("+01:00"))>
[
  1970-01-02T00:00:05,
  1970-01-01T00:00:01,
  null,
]

Whereas

let a = Arc::new(TimestampSecondArray::from(vec![Some(86405), Some(1), None])
            .with_timezone("+01:00".to_string())) as ArrayRef;
    let t = cast(&a, &DataType::Utf8).unwrap();
    println!("{:?}", t);

Returns

StringArray
[
  "1970-01-02 01:00:05 +01:00",
  "1970-01-01 01:00:01 +01:00",
  null,
]

Expected behavior

The string cast was fixed by @viirya in #2608

Additional context

FYI @waitingkuo

@waitingkuo
Copy link
Contributor

@tustvold
i think this is similar as #2917
i only fixed the prettyprint one but not the debut information because i'm not sure is it intended to let the user to see the underline timestamp

@waitingkuo
Copy link
Contributor

i can submit a pr for this if showing timestamp with time zone shift is preffered

@tustvold
Copy link
Contributor Author

tustvold commented Nov 9, 2022

Aah yes closing as duplicate of #2917

And I at least found the inconsistency very confusing

@tustvold tustvold closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2022
@alamb
Copy link
Contributor

alamb commented Nov 11, 2022

label_issue.py automatically added labels {'arrow'} from #3016

@alamb alamb added the arrow Changes to the arrow crate label Nov 11, 2022
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 bug
Projects
None yet
Development

No branches or pull requests

3 participants