GoogleCloudPlatform / analytics-componentized-patterns

Apache License 2.0
173 stars 97 forks source link

requirements.txt used for bqml_ga4_gaming_propensity_to_churn.ipynb example needed #57

Closed jimwill3 closed 3 years ago

jimwill3 commented 3 years ago

Hi, I've tried quite a few permutations of google-cloud-bigquery, google-cloud-bigquery-storage, pyrarrow, google-cloud-core, and google-api-core without any success in making queries to bigquery. I've gotten grpc errors, then client_credential missing attribute errors, and so on. is there a requirements.tx showing what versions of packages were used to run the sample? the particular sample is: bqml_ga4_gaming_propensity_to_churn.ipynb thanks, jim

polong-lin commented 3 years ago

Hi Jim, Would you mind pasting the error here and what environment you're using to run the notebook (and authentication steps, if any)?

jimwill3 commented 3 years ago

Hi, AI Platform notebooks - Tensorflow 2.3 build.(fresh instance created 30 minutes before running this notebook) !sudo pip install google-cloud-bigquery

restart kernel

from google.cloud import bigquery import pandas as pd

pd.set_option('display.float_format', lambda x: '%.3f' % x) print(bigquery.version)

2.13.1

%%bigquery --project $PROJECT_ID

SELECT FROM `firebase-public-project.analytics153293282.events` TABLESAMPLE SYSTEM (1 PERCENT)

AttributeError: 'ClientOptions' object has no attribute 'credentials_file'

after about 2 hours of searching around I found this suggested workaround on stackoverflow: !sudo /opt/conda/bin/conda install -c conda-forge google-cloud-bigquery google-cloud-bigquery-storage pandas pyarrow --yes !pip install google-cloud-bigquery

restart the kernel - code now works. thanks, jim


From: Polong Lin @.> Sent: Monday, April 19, 2021 3:31 PM To: GoogleCloudPlatform/analytics-componentized-patterns @.> Cc: jimwill3 @.>; Author @.> Subject: Re: [GoogleCloudPlatform/analytics-componentized-patterns] requirements.txt used for bqml_ga4_gaming_propensity_to_churn.ipynb example needed (#57)

Hi Jim, Would you mind pasting the error here and what environment you're using to run the notebook (and authentication steps, if any)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/GoogleCloudPlatform/analytics-componentized-patterns/issues/57#issuecomment-822728542, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEFVVF4V2EXWQH4Y3IEOWXTTJSAH5ANCNFSM43GBLNOA.

polong-lin commented 3 years ago

Thanks for following up and with your solution! I'll add it to the notebook for future users who may run into the same issue.