ibis icon indicating copy to clipboard operation
ibis copied to clipboard

Bigquery: ibis.connect doesn't pass through parameters parsed from connection string

Open ssabdb opened this issue 1 year ago • 1 comments

With version 9.0.0 of ibis, passing:

ibis.connect(bigquery://my_project/my_dataset?location=us-central1)

Does not pass the parameters to backend._from_url. I would expect location=us-central1 to be passed to the underlying bigquery connection.

I'm not sure if this is intentional, because the ibis.connect function goes to the trouble of parsing the parameters from the connection string but then uses orig_kwargs for

https://github.com/ibis-project/ibis/blob/33ec7547209cc7775f85bd46a30f971333ea35bb/ibis/backends/init.py#L1394

Alternatively, it could be solved in a backend specific way for bigquery by parsing out the configuration here:

https://github.com/ibis-project/ibis/blob/33ec7547209cc7775f85bd46a30f971333ea35bb/ibis/backends/bigquery/init.py#L335

My usecase (and why I don't particularly want to specify location directly) is that I want users to be able to pass any connection string they want through to Ibis from configuration and use this as a means to configure the connection appropriately, subject to me filtering supported backends for my application. I haven't tried parameters with any other of the backends.

This is similar to the sqlalchemy connection string logic mentioned in https://github.com/ibis-project/ibis/issues/2532#issuecomment-794573375.

Any advice on how the general ibis connection strings handle parameters like this for a consistent user experience? I'd be happy to submit a PR for the latter option, it should be quite simple.

ssabdb avatar Jun 27 '24 18:06 ssabdb

Looks like a bug, I'll poke around a bit to confirm!

cpcloud avatar Jun 27 '24 18:06 cpcloud