Colab InteractiveContext Unable to Determine ProjectID for BQ
See original GitHub issueWhen trying to use TFX in Colab, specifically the BigQueryExampleGen, there is an issue where we get the following error regarding the GCP project_id: “Project was not passed and could not be determined from the environment.”
gcloud config list
shows the project is recognized, so the issue is within the last, or second-to-last line.
Perhaps there is a parameter within InteractiveContext()
or BigQueryExampleGen()
, but I couldn’t find any documentation on this. Is there a way to specify the project_id in any of these functions? Or is this a bug?
Below is the exact replica of the issue:
from tfx.orchestration.experimental.interactive.interactive_context import InteractiveContext
from tfx.components.example_gen.big_query_example_gen.component import BigQueryExampleGen
from google.cloud import bigquery
from google.colab import auth
auth.authenticate_user( )
project_id = 'Project-ID'
!gcloud config set project {project_id}
!gcloud config list
context = InteractiveContext()
QUERY = '''
SELECT *
FROM `bigquery-public-data.chicago_taxi_trips.taxi_trips`
LIMIT 1000
'''
example_gen = BigQueryExampleGen(query=QUERY )
context.run(example_gen)
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
how to run BigQueryExampleGen in Jupyter notebook - Stack ...
To run in GCP, need to provide the project ID via beam_pipeline_args argument. Colab InteractiveContext Unable to Determine ProjectID for BQ ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@luischinchillagarcia can you try installing
pip install -i https://test.pypi.org/simple/ tfx==0.16.0.dev20191105
and then addingcontext.run(..., beam_pipeline_args=['--project', 'my-project'])
?#888 is merged into master, could you try again?