Easily set up a data stack using Airbyte, dbt, BigQuery, and Dagster to pull weather data from WeatherStack API, put it into BigQuery, and play around with it using dbt and Dagster.
Download our free guide and discover the best approach for your needs, whether it's building your ELT solution in-house or opting for Airbyte Open Source or Airbyte Cloud.
Download our free guide and discover the best approach for your needs, whether it's building your ELT solution in-house or opting for Airbyte Open Source or Airbyte Cloud.
Welcome to the "Weather Data Stack" repository! 🌟 This is your go-to place to easily set up a data stack using Airbyte, dbt, BigQuery, and Dagster. With this setup, you can pull weather data from WeatherStack API, put it into BigQuery, and play around with it using dbt and Dagster.
This Quickstart is all about making things easy, getting you started quickly and showing you how smoothly all these tools can work together!
Before you embark on this integration, ensure you have the following set up and ready:
Get the project up and running on your local machine by following these steps:
1. Clone the repository (Clone only this quickstart):
2. Navigate to the directory
3. Set Up a Virtual Environment:
• For Mac:
• For Windows:
4. Install Dependencies:
To extract weather data from the Weatherstack API and store the API key in its own environment variable file, you can follow these steps:
raw_data
for Airbyte and transformed_data
for dbt.How to create a dataset:
raw_data
or transformed_data
).airbyte-service-account
).dbt-service-account
) and assign the roles.How to create a service account and assign roles:
How to generate JSON key:
Here, you can set up connectors with source and destination manually using the Airbyte UI.
Use the generated public url from the previous step to manually configure using the File Option as source under public HTPPS.
dbt (data build tool) allows you to transform your data by writing, documenting, and executing SQL workflows. Setting up the dbt project requires specifying connection details for your data platform, in this case, BigQuery. Here’s a step-by-step guide to help you set this up:
1. Navigate to the dbt Project Directory:
Change to the directory containing the dbt configuration:
2. Update Connection Details:
You'll find a profiles.yml
file within the directory. This file contains configurations for dbt to connect with your data platform. Update this file with your BigQuery connection details.
3. Utilize Environment Variables (Optional but Recommended):
To keep your credentials secure, you can leverage environment variables. An example is provided within the profiles.yml
file.
4. Test the Connection:
Once you’ve updated the connection details, you can test the connection to your BigQuery instance using:
If everything is set up correctly, this command should report a successful connection to BigQuery.
5. Run the Models:
If you would like to run the dbt models manually at this point, you can do so by executing:
You can verify the data has been transformed by going to BigQuery and checking the transformed_data
dataset.
Dagster is a modern data orchestrator designed to help you build, test, and monitor your data workflows. In this section, we'll walk you through setting up Dagster to oversee both the Airbyte and dbt workflows:
1. Navigate to the Orchestration Directory:
Switch to the directory containing the Dagster orchestration configurations:
2. Set Environment Variables:
Dagster requires certain environment variables to be set to interact with other tools like dbt and Airbyte. Set the following variables:
Note: The AIRBYTE_PASSWORD
is set to password
as a default for local Airbyte instances. If you've changed this during your Airbyte setup, ensure you use the appropriate password here.
3. Launch the Dagster UI:
With the environment variables in place, kick-start the Dagster UI:
4. Access Dagster in Your Browser:
Open your browser and navigate to:
Here, you should see assets for both Airbyte and dbt.
Congratulations on deploying and running the Weather Data Stack Quistart! 🎉 Here are some suggestions on what you can explore next to dive deeper and get more out of your project: