Skip to content
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

Support for coercing to floats #476

Open
rjrudin opened this issue Jan 24, 2022 · 0 comments
Open

Support for coercing to floats #476

rjrudin opened this issue Jan 24, 2022 · 0 comments
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@rjrudin
Copy link

rjrudin commented Jan 24, 2022

Is your feature request related to a problem? Please describe.

This is related to #474 , as we try to migrate from pandas.read_sql_query to either pandas.read_gbq or pandas_gbq.read_gbq. The issue here is that we use read_sql_query with coerce_float=True, but with read_gbq, our tests that expect float conversion.

Describe the solution you'd like

We'd like the equivalent of coerce_float as an argument for read_gbq.

Describe alternatives you've considered

We are looking into whether we can not assume the use of coerce_float=True, but in the short term, having coerce_float support would allow us to preserve our existing functionality and gain the significantly increased performance of read_gbq.

We also looked into using the dtypes argument in pandas_gbq.read_gbq, but that's not viable for us in scenarios where we don't know the schema ahead of time - i.e. a user provides connection details and says "Hey, read a dataframe from here". It would be feasible to check out the table schema and infer a dtypes argument based on it, but life would of course be a lot simpler if we could do what we're doing with pandas.read_sql_query and rely on coerce_float.

Additional context

N/A

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-pandas API. label Jan 24, 2022
@tswast tswast added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants