tristanbilot / bqfetch Goto Github PK
View Code? Open in Web Editor NEWA lightweight tool to fetch tables from BigQuery as pandas DataFrame very fast using BigQuery Storage API combined with multiprocessing
License: MIT License
A lightweight tool to fetch tables from BigQuery as pandas DataFrame very fast using BigQuery Storage API combined with multiprocessing
License: MIT License
Hi Team,
I'm trying to use bqfetch library to fetch bigquery table.
I would like to know whether what file are you referring to . can you elaborate more about and where can I JSON file in my project.
since I dont see enough info in github repo, raising this request.
fetcher = BigQueryFetcher('/path/to/service_account.json', table)
Thanks in advance.
Regards
Nirmal NK
Hi everyone !
I'm trying to read a big table from BigQuery using python in google colab and I found bqfetch, however, when I try to import BigQueryFetcher and BigQueryTable I get an error.
I installed it by doing:
!pip install bqfetch
!pip install -r requirements.txt
But when running the second command, I get this error:
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
Then, my code is this:
from bqfetch import BigQueryFetcher, BigQueryTable
table = BigQueryTable("PROJECT", "DATASET", "TABLE")
fetcher = BigQueryFetcher('/path/to/bq_service_account.json', table)
chunks = fetcher.chunks('id', by_chunk_size_in_GB=2)
for chunk in chunks:
df = fetcher.fetch(chunk, nb_cores=1, verbose=True)
Am I doing something wrong ? Because this is what I get:
Some help would be appreciated! Because I cannot run anything so I can't get the table I need in order to have as a dataframe in python :(
Thank you in advance!
Marina
Hello,
thank you very much for the library, I agree it seems to be very promising!
Is it possible to add the project id as a parameter of the BigQueryClient?
Sometimes the project where the service account was created and the project of the dataset to be accessed may be different, for example in my case it fails due to the lack of the correct roles/permissions in the service account project, so the following piece of code of bqfetch.py fails:
bq_client = bigquery.Client(
credentials=credentials,
project=credentials.project_id
)
while using directly bigquery.Client():
bigquery.Client(credentials=credentials, project=bq_project_id)
works correctly.
Thank you,
Steven
Hello,
Thank you for a such useful library!
I am trying to fetch the table as it mentioned on the column that contains distinct values, but anyway getting an error:
InvalidChunkRangeException: Difference of range between elements of column datetime_tzutc is too high: more than 25.0% of elements are too far from the mean.
Could you, please, give me advices how should I handle this case?
Thank you in advance!
Best,
Veniamin
Hi @TristanBilot, first of all thanks for creating this library - seems to be very promising!
I was exploring using it in one of my projects and realized that it would be great if it supported fetching data only from specific partition(s) as opposed to the whole table.
Do you have any plans on adding that feature?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.