jorgecarleitao commented on a change in pull request #9445:
URL: https://github.com/apache/arrow/pull/9445#discussion_r572259758
##########
File path: rust/datafusion/src/execution/context.rs
##########
@@ -287,6 +287,21 @@ impl ExecutionContext {
.insert(name.to_string(), provider.into());
}
+ /// Deregisters the named table.
+ ///
+ /// Returns true if the table was successfully de-reregistered.
+ pub fn deregister_table(
+ &mut self,
+ name: &str
+ ) -> bool {
Review comment:
my thinking was that as a user, if a function returns a `bool`, I am
incentivized to write `let _ = ctx.deregister_table(table)` to ignore the
value. If the function returns an error, I am incentivized to think about what
to do with it (typically a `unwrap` or `?`). So, imo, either a `Result<()>` or
`()` seemed most reasonable.
Taking a step back, I can see that `register_table` currently just silently
overwrites an existing table. So, for consistency, returning `()` makes sense.
OTOH, I am not convinced that `register_table`s API is though through: a user
can silently overwrite a table 🤯
Anyways, let's try to clean these later. I think that this PR is useful as
is 👍
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]