Skip to content

fix: write error for dbg output of out of range timestamps#10130

Open
Jefffrey wants to merge 3 commits into
apache:mainfrom
Jefffrey:fix-timestamp-out-of-range-dbg
Open

fix: write error for dbg output of out of range timestamps#10130
Jefffrey wants to merge 3 commits into
apache:mainfrom
Jefffrey:fix-timestamp-out-of-range-dbg

Conversation

@Jefffrey

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Confusing to print null when the value is not formattable via chrono, so instead clearly write an error.

What changes are included in this PR?

Instead of writing null in debug output of timestamp arrays for values that exceed chronos range, write an error message for that row similar to date/time types

Are these changes tested?

Yes.

Are there any user-facing changes?

Not really.

@github-actions github-actions Bot added the arrow Changes to the arrow crate label Jun 12, 2026
@Jefffrey Jefffrey marked this pull request as ready for review June 12, 2026 04:39
None => write!(f, "null"),
None => write!(
f,
"Cast error: Failed to convert {v} to timestamp for {data_type}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same error message format as date & time branches above

}

#[test]
fn test_timestamp_micros_out_of_range() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consolidated this into newly added test

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to debug print large Timestamp(TimeUnit::Microsecond) values

1 participant