question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Colab InteractiveContext Unable to Determine ProjectID for BQ

See original GitHub issue

When 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:closed
  • Created 4 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
charlesccychencommented, Nov 6, 2019

@luischinchillagarcia can you try installing pip install -i https://test.pypi.org/simple/ tfx==0.16.0.dev20191105 and then adding context.run(..., beam_pipeline_args=['--project', 'my-project'])?

1reaction
1025KBcommented, Nov 5, 2019

#888 is merged into master, could you try again?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found