alamb opened a new pull request, #5676: URL: https://github.com/apache/arrow-datafusion/pull/5676
# Which issue does this PR close? N/A # Rationale for this change @andygrove reported on [ASF Slack](https://the-asf.slack.com/archives/C01QUFS30TD/p1679408811522469 > I am trying to upgrade Ray SQL to DataFusion 20, and running into problems trying to create the new Extensions param to TaskContext::try_new > The struct is defined as: > #[derive(Debug, Default, Clone)] > pub struct Extensions(BTreeMap<&'static str, ExtensionBox>); > I am hitting this error: > error[E0423]: cannot initialize a tuple struct which contains private fields > --> src/context.rs:177:13 > | > 177 | Extensions(BTreeMap::new()) > | ^^^^^^^^^^ > | > note: constructor is not visible here due to private fields > Am I missing something obvious here, or is it no longer possible to create TaskContext outside of the core project? Turns out the answer was `Extensions::default`: > [11:10 AM](https://the-asf.slack.com/archives/C01QUFS30TD/p1679411408660439) > ah, nm, ... ` > Extensions::default() # What changes are included in this PR? Add an `Extensions::new()` which is the idiomatic way to create "new" objects in Rust # Are these changes tested? Yes -- updated existing tests # Are there any user-facing changes? Slightly better ergonomics and discoverability -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
