-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): support SchemaLike
in Backend.create_table()
#9885
feat(api): support SchemaLike
in Backend.create_table()
#9885
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good idea to me!
Ideally in the docs, I would want the type annotations to boil down to the base types, and show that schema can be a Mapping, an ibis Schema, an interable of str,str pairs, etc. But, if we use the nice shorthand |
599256a
to
12db8cd
Compare
I just threw up the test and implemented it for a few backends, let's see which actually fail and need an implementation change |
e8b429b
to
ccb001a
Compare
hmm, darn, yeah the docs render as the opaque "SchemaLike". Any opinions here on what this should look like? The quartodoc documentation is intimidating for me, I'm not sure if there is some option in there of |
ccb001a
to
6ceb639
Compare
Let's really try to avoid getting caught up in the docs issue so that the PR can be merged quickly. The rendering of types in docs is separate from this PR. |
SchemaLike
in Backend.create_table()
6ceb639
to
339ec98
Compare
This requires a test and implementation for other backends, but I wanted to get some feedback before I went for it.
Currently, you have to pass a real ibis.Schema to create_table(). Now it supports dicts and iterables of (name, type) pairs.
This is now consistent with
ibis.table()
.Example usage:
currently, this errors. With this change, it works.