martin-g commented on code in PR #21049:
URL: https://github.com/apache/datafusion/pull/21049#discussion_r2960340305
##########
datafusion/sqllogictest/src/test_context.rs:
##########
@@ -265,14 +245,10 @@ fn register_strict_orders_catalog(ctx: &SessionContext) {
orders: Arc::new(orders),
});
- // Override the default "datafusion" catalog for this test file so that any
- // unexpected lookup is caught immediately.
- ctx.register_catalog(
- "datafusion",
- Arc::new(StrictOrdersCatalog {
- schema: schema_provider,
- }),
- );
+ ctx.catalog("datafusion")
+ .expect("default catalog should exist")
+ .register_schema("strict_schema", schema_provider)
+ .unwrap();
Review Comment:
```suggestion
let previous = ctx
.catalog("datafusion")
.expect("default catalog should exist")
.register_schema("strict_schema", schema_provider)
.expect("strict schema registration should succeed");
assert!(
previous.is_none(),
"strict_schema unexpectedly already existed in datafusion catalog"
);
```
I think it would make sense to verify that there is no schema with the same
name created by another test. If the same schema is used in multiple tests then
such leftovers may lead to hard to debug problems in one test caused by
leftovers from another test
--
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]