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 has an inconsistent behavior when it comes to reading and writing tables to BigQuery dataset.
When reading a table, ibis does not require a connection to specify the dataset_id in ibis.bigquery.connect. We can then specify the dataset with either a namespaced table name such as dataset_name.table_name or use the database argument in reading a table. And ibis will raise if we specify both. It will also raise when no dataset_id is specified in connection and no namespace or database are provided in reading table.
For example, the following code will raise IbisInputError: Cannot specify database both in the table name and as an argument:
So far so good, however, things are very different as we are writing a table.
When writing a table, namespaced table name does NOT work, which means a dataset must be specified as either connection argument (dataset_id) or a saving argument (database). And the later overwrite the former. A surprising behavior is that, when BOTH a namespaced table and a database argument are specified, the dataset in namespace overwrites the argument.
For example, the following will raise ValueError: Unable to determine BigQuery dataset.:
The expected behavior (for consistency) should be that we can either save the table using namespaced table name without dataset argument, or we can save it without namespaced table name but with a dataset argument, and it should raise when both are specified.
What version of ibis are you using?
9.5.0
What backend(s) are you using, if any?
BigQuery
Relevant log output
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
BigQuery is the only backend (I think) that supports dotted path locations as the table name, which dates back to when it was independently maintained as a third-party backend.
We should definitely resolve the idiosyncrasies here.
What happened?
Ibis has an inconsistent behavior when it comes to reading and writing tables to BigQuery dataset.
When reading a table, ibis does not require a connection to specify the
dataset_id
inibis.bigquery.connect
. We can then specify the dataset with either a namespaced table name such asdataset_name.table_name
or use thedatabase
argument in reading a table. And ibis will raise if we specify both. It will also raise when nodataset_id
is specified in connection and no namespace ordatabase
are provided in reading table.For example, the following code will raise
IbisInputError: Cannot specify database both in the table name and as an argument
:and the followings are fine, both can read the table
test
from datasettest1
:So far so good, however, things are very different as we are writing a table.
When writing a table, namespaced table name does NOT work, which means a dataset must be specified as either connection argument (
dataset_id
) or a saving argument (database
). And the later overwrite the former. A surprising behavior is that, when BOTH a namespaced table and adatabase
argument are specified, the dataset in namespace overwrites the argument.For example, the following will raise
ValueError: Unable to determine BigQuery dataset.
:and this will (surprisingly) save the table
test
totest1
.which is rather confusing.
The expected behavior (for consistency) should be that we can either save the table using namespaced table name without dataset argument, or we can save it without namespaced table name but with a dataset argument, and it should raise when both are specified.
What version of ibis are you using?
9.5.0
What backend(s) are you using, if any?
BigQuery
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: