Copilot commented on code in PR #20362:
URL: https://github.com/apache/datafusion/pull/20362#discussion_r2837588808
##########
datafusion/datasource/src/file_scan_config.rs:
##########
@@ -1295,21 +1350,23 @@ impl Debug for FileScanConfig {
impl DisplayAs for FileScanConfig {
fn fmt_as(&self, t: DisplayFormatType, f: &mut Formatter) -> FmtResult {
- let schema = self.projected_schema().map_err(|_| std::fmt::Error {})?;
- let orderings = get_projected_output_ordering(self, &schema);
+ let eq_props = self.eq_properties();
+ let orderings = eq_props.oeq_class();
write!(f, "file_groups=")?;
FileGroupsDisplay(&self.file_groups).fmt_as(t, f)?;
- if !schema.fields().is_empty() {
+ if let Ok(schema) = self.projected_schema()
+ && !schema.fields().is_empty()
+ {
Review Comment:
`DisplayAs::fmt_as` now silently ignores `projected_schema()` errors (by
using `if let Ok(schema) = ...`) and just omits the projection. This changes
prior behavior (formatting would fail) and can mask real schema/projection
bugs, producing confusing output (e.g., orderings printed against a schema that
isn't shown). Consider restoring the previous error propagation
(`projected_schema().map_err(|_| fmt::Error)?`) or printing an explicit
placeholder when schema computation fails so issues are visible and behavior
stays consistent with `DataSource::fmt_as` which still errors on
`projected_schema()` failure.
```suggestion
let schema = self
.projected_schema()
.map_err(|_| std::fmt::Error)?;
if !schema.fields().is_empty() {
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]