
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Disable and re-enable the Dataflow API
/ 10
Create a Cloud Storage Bucket
/ 10
Copy Files to Your Bucket
/ 10
Create the BigQuery Dataset (name: lake)
/ 20
Build a Data Ingestion Dataflow Pipeline
/ 10
Build a Data Transformation Dataflow Pipeline
/ 10
Build a Data Enrichment Dataflow Pipeline
/ 10
Build a Data lake to Mart Dataflow Pipeline
/ 20
In Google Cloud, you can build data pipelines that execute Python code to ingest and transform data from publicly available datasets into BigQuery using these Google Cloud services:
In this lab, you use these services to create your own data pipeline, including the design considerations and implementation details, to ensure that your prototype meets the requirements. Be sure to open the Python files and read the comments when instructed.
In this lab, you learn how to:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
Click Activate Cloud Shell at the top of the Google Cloud console.
Click through the following windows:
When you are connected, you are already authenticated, and the project is set to your Project_ID,
gcloud
is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Output:
Output:
gcloud
, in Google Cloud, refer to the gcloud CLI overview guide.
To ensure access to the necessary API, restart the connection to the Dataflow API.
In the Cloud Console, enter "Dataflow API" in the top search bar. Click on the result for Dataflow API.
Click Manage.
Click Disable API.
If asked to confirm, click Disable.
When the API has been enabled again, the page will show the option to disable.
Click Check my progress to verify your performed task.
Click Check my progress to verify your performed task.
gsutil
command in the Cloud Shell to copy files into the Cloud Storage bucket you just created:Click Check my progress to verify your performed task.
lake
. This is where all of your tables will be loaded in BigQuery:Click Check my progress to verify your performed task.
In this section you will create an append-only Dataflow which will ingest data into the BigQuery table. You can use the built-in code editor which will allow you to view and edit the code in the Google Cloud console.
You will now build a Dataflow pipeline with a TextIO source and a BigQueryIO destination to ingest data into BigQuery. More specifically, it will:
In the Code Editor navigate to dataflow-python-examples
> dataflow_python_examples
and open the data_ingestion.py
file. Read through the comments in the file, which explain what the code is doing. This code will populate the dataset lake with a table in BigQuery.
The Dataflow job in this lab requires Python3.8
. To ensure you're on the proper version, you will run the Dataflow processes in a Python 3.8 Docker container.
This command will pull a Docker container with the latest stable version of Python 3.8 and execute a command shell to run the next commands within the container. The -v
flag provides the source code as a volume
for the container so that we can edit in Cloud Shell editor and still access it within the running container.
apache-beam
in that running container:Click on the name of your job to watch it's progress. Once your Job Status is Succeeded, you can move to the next step. This Dataflow pipeline will take approximately five minutes to start, complete the work, and then shutdown.
Navigate to BigQuery (Navigation menu > BigQuery) see that your data has been populated.
lake
dataset.usa_names
data.usa_names
table, try refreshing the page or view the tables using the classic BigQuery UI.
Click Check my progress to verify your performed task.
You will now build a Dataflow pipeline with a TextIO source and a BigQueryIO destination to ingest data into BigQuery. More specifically, you will:
In the Code Editor, open data_transformation.py
file. Read through the comments in the file which explain what the code is doing.
You will run the Dataflow pipeline in the cloud. This will spin up the workers required, and shut them down when complete.
Navigate to Navigation menu > Dataflow and click on the name of this job to view the status of your job. This Dataflow pipeline will take approximately five minutes to start, complete the work, and then shutdown.
When your Job Status is Succeeded in the Dataflow Job Status screen, navigate to BigQuery to check to see that your data has been populated.
You should see the usa_names_transformed table under the lake
dataset.
Click on the table and navigate to the Preview tab to see examples of the usa_names_transformed
data.
usa_names_transformed
table, try refreshing the page or view the tables using the classic BigQuery UI.
Click Check my progress to verify your performed task.
You will now build a Dataflow pipeline with a TextIO source and a BigQueryIO destination to ingest data into BigQuery. More specifically, you will:
In the Code Editor, open data_enrichment.py
file.
Check out the comments which explain what the code is doing. This code will populate the data in BigQuery.
Line 83 currently looks like:
Here you'll run the Dataflow pipeline in the cloud.
Navigate to Navigation menu > Dataflow to view the status of your job. This Dataflow pipeline will take approximately five minutes to start, complete the work, and then shutdown.
Once your Job Status is Succeed in the Dataflow Job Status screen, navigate to BigQuery to check to see that your data has been populated.
You should see the usa_names_enriched table under the lake
dataset.
usa_names_enriched
data.usa_names_enriched
table, try refreshing the page or view the tables using the classic BigQuery UI.
Click Check my progress to verify your performed task.
Now build a Dataflow pipeline that reads data from two BigQuery data sources, and then joins the data sources. Specifically, you:
In the Code Editor, open data_lake_to_mart.py
file. Read through the comments in the file which explain what the code is doing. This code will join two tables and populate the resulting data in BigQuery.
Now run the Dataflow pipeline in the cloud.
Navigate to Navigation menu > Dataflow and click on the name of this new job to view the status. This Dataflow pipeline will take approximately five minutes to start, complete the work, and then shutdown.
Once your Job Status is Succeeded in the Dataflow Job Status screen, navigate to BigQuery to check to see that your data has been populated.
You should see the orders_denormalized_sideinput table under the lake
dataset.
orders_denormalized_sideinput
data.orders_denormalized_sideinput
table, try refreshing the page or view the tables using the classic BigQuery UI.
Click Check my progress to verify your performed task.
Below are multiple choice questions to reinforce your understanding of this lab's concepts. Answer them to the best of your abilities.
You executed Python code using Dataflow to ingest data into BigQuery and transform the data.
Looking for more? Check out official documentation on:
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated February 11, 2024
Lab Last Tested October 12, 2023
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one