Skip to content

Make ArrayFormatterFactory Send + Sync and add a test#8878

Merged
alamb merged 1 commit into
apache:mainfrom
tschwarzinger:custom-formatters
Nov 19, 2025
Merged

Make ArrayFormatterFactory Send + Sync and add a test#8878
alamb merged 1 commit into
apache:mainfrom
tschwarzinger:custom-formatters

Conversation

@tschwarzinger
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Ping @alamb

Rationale for this change

FormatOptions is no longer Send and Sync.

What changes are included in this PR?

  • Require Send + Sync for ArrayFormatterFactory
  • Assertion that FormatOptions is Send + Sync

Are these changes tested?

  • Yes

Are there any user-facing changes?

Yes, should fix the compiler error. I could compile DataFusion with the following patch adapted from the issue:

## Temporary arrow-rs patch until 57.1.0 is released

[patch.crates-io]
arrow = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }
arrow-array = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }
arrow-buffer = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }
arrow-cast = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }
arrow-data = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }
arrow-ipc = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }
arrow-schema = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }
arrow-select = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }
arrow-string = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }
arrow-ord = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }
arrow-flight = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }
parquet = { git = "https://github.com/tobixdev/arrow-rs.git", branch = "custom-formatters" }

@github-actions github-actions Bot added the arrow Changes to the arrow crate label Nov 19, 2025
Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @tobixdev 🙏

Comment thread arrow-cast/src/display.rs
/// See https://github.com/apache/arrow-rs/issues/8875
#[test]
fn test_options_send_sync() {
fn assert_send_sync<T>()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❤️

@alamb alamb merged commit 6675204 into apache:main Nov 19, 2025
26 checks passed
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.

(dyn ArrayFormatterFactory + 'static) can't be safely shared between threads

2 participants