timsaucer commented on code in PR #18080:
URL: https://github.com/apache/datafusion/pull/18080#discussion_r2433974993


##########
datafusion/core/src/datasource/listing/table.rs:
##########
@@ -1638,15 +191,18 @@ mod tests {
         let ctx = SessionContext::new();
         let testdata = datafusion_test_data();
         let filename = format!("{testdata}/aggregate_simple.csv");
-        let table_path = ListingTableUrl::parse(filename).unwrap();
+        let table_path = ListingTableUrl::parse(filename)?;
 
         // Test default schema source
         let config = ListingTableConfig::new(table_path.clone());
         assert_eq!(config.schema_source(), SchemaSource::Unset);
 
         // Test schema source after setting a schema explicitly
         let provided_schema = create_test_schema();
-        let config_with_schema = 
config.clone().with_schema(provided_schema.clone());
+        let config_with_schema = config
+            .clone()
+            .with_listing_options(mock_listing_config_options())

Review Comment:
   If we don't set listing options before calling `with_schema` then we will 
get an assert. This doesn't happen in the original because there is a clause 
for when you are building as a test. However those `cfg(test)` do not get 
carried over from a dependency. Since this is calling into a different crate, 
we now erroneously get an assert in the test. I added a mock so that we would 
have *some* option set but didn't want to put the actual expected options that 
come later in these tests.



-- 
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]

Reply via email to