Skip to content

datafold/bigquery-notebook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BigQuery Notebook

Jupyter notebook for translating SQL queries from Snowflake to BigQuery using the Datafold DMA SDK.

Setup

Install dependencies:

uv sync

Running the Notebook

Start Jupyter Notebook:

uv run jupyter notebook

The server will start and provide a URL with an access token to open in your browser.

Local Development

Create a .env file and set LOCAL_DMA_SDK_PATH pointing to the dma-sdk repo. The notebook will then install using pip install -e which allows editing the SDK code. The code gets automatically refreshed every time you run a cell.

Example .env file:

LOCAL_DMA_SDK_PATH=/path/to/dma-sdk

Add the following cell to the notebook to install the SDK from your local environment.

# FOR LOCAL DEVELOPMENT, NOT NEEDED ON COLAB/DATABRICKS
import os
import pathlib
from dotenv import load_dotenv
load_dotenv()

LOCAL_DMA_SDK_PATH = os.getenv('LOCAL_DMA_SDK_PATH')
if LOCAL_DMA_SDK_PATH and pathlib.Path(LOCAL_DMA_SDK_PATH).exists():
    print(f"Installing dma-sdk from {LOCAL_DMA_SDK_PATH}")
    %pip install --editable "{LOCAL_DMA_SDK_PATH}"
    
    # Restart to make dependencies available
    import IPython
    app = IPython.Application.instance()
    app.kernel.do_shutdown(True)

About

Notebook for Snowflake -> BigQuery translations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •