datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

refactor: `SchemaProvider::table` can fail

Open crepererum opened this issue 1 year ago • 0 comments

Which issue does this PR close?

Closes #9305.

Rationale for this change

SchemaProvider::table is async and clearly allows IO:

https://github.com/apache/arrow-datafusion/blob/6fad5ed7a37c50b9c200f214c3e13b0e1f0cecbc/datafusion/core/src/catalog/schema.rs#L114-L116

However this method cannot fail. Casting errors to None is semantically wrong.

What changes are included in this PR?

Change return type from Option<Arc<dyn TableProvider>> to Result<Option<Arc<dyn TableProvider>>, DataFusionError>.

Are these changes tested?

It compiles.

Are there any user-facing changes?

Breaking: Interface change.

crepererum avatar Feb 21 '24 14:02 crepererum