You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ibis supports datafusion as one of our backends, and we make use of datafusion-python in service of that.
One of the thornier issues we face right is that Datafusion returns Exception as the exception type when a table isn't found.
The exception message is more specific, but on the Python side, it is generally not a good move to catch a bare Exception -- and we're in the position of having to catch it, then parse the exception message, then continue as appropriate.
[ins] In [5]: fromdatafusionimportSessionContext
[ins] In [6]: c=SessionContext()
[ins] In [7]: c.table("notatable")
---------------------------------------------------------------------------ExceptionTraceback (mostrecentcalllast)
CellIn[7], line1---->1c.table("notatable")
Exception: DataFusionerror: Plan("No table named 'notatable'")
conversely, attempting to look at a catalog that doesn't exist:
[ins] In [9]: c.catalog("nope")
---------------------------------------------------------------------------KeyErrorTraceback (mostrecentcalllast)
CellIn[9], line1---->1c.catalog("nope")
KeyError: "Catalog with name nope doesn't exist."
That's much nicer.
Describe the solution you'd like
Either a datafusion-specific error message, or raise a KeyError (or some other more specific error type.
Describe alternatives you've considered
Catching and parsing, as described above, but it's suboptimal.
Thanks!
The text was updated successfully, but these errors were encountered:
Ibis supports datafusion as one of our backends, and we make use of
datafusion-python
in service of that.One of the thornier issues we face right is that Datafusion returns
Exception
as the exception type when a table isn't found.The exception message is more specific, but on the Python side, it is generally not a good move to catch a bare
Exception
-- and we're in the position of having to catch it, then parse the exception message, then continue as appropriate.conversely, attempting to look at a
catalog
that doesn't exist:That's much nicer.
Describe the solution you'd like
Either a datafusion-specific error message, or raise a
KeyError
(or some other more specific error type.Describe alternatives you've considered
Catching and parsing, as described above, but it's suboptimal.
Thanks!
The text was updated successfully, but these errors were encountered: