Skip to content

LookML Development Practices

This document outlines the best practices for developing LookML models in the Data Team. #TODO review the practices with team

Naming Conventions

Measures:

  • Use number_ prefix for count measures
    • Example: number_of_users, number_of_transactions
  • Use total_ prefix for sum measures
    • Example: total_amount, total_revenue
link: {
  label: "Open in Hydra"
  url: "https://hydra.majority.com/user/{{ value }}"
}
link: {
  label: "Open in Hydra - KYC Attempt"
  url: "https://hydra.majority.com/kyc/{{ view_name.user_id._value | url_encode }}/{{ value | url_encode }}"
}
link: {
  label: "Open in Alloy - Document"
  url: "https://app.alloy.co/entities/{{ value }}/?tab=documents"
}

Adding a New Model

When adding a new model to Looker, complete these two configuration steps:

1. Configure Project Connection

  1. Go to Develop > Projects
  2. You'll see the new project is not configured
  3. Click Configure
  4. Save the bq_majority connection

2. Update User Roles

  1. Go to Admin > Users > Roles
  2. Add the new model to the appropriate roles
  3. Typically add to majority_user role for standard users
  4. Admins automatically have access to all models

Git Integration Setup

This guide explains how to configure your GitHub credentials for Looker so that your commits are attributed to your own GitHub account.

Prerequisites:

  • A GitHub account with access to the relevant repositories
  • A Looker account with developer permissions

Step 1: Create a GitHub Personal Access Token (PAT)

  1. Go to GitHub Personal Access Tokens

  2. Click Generate new token

  3. Configure the token:

    Field Value
    Resource owner Select majority-dev (not your personal account)
    Note Looker Git Integration
    Expiration Choose based on your preference (e.g., 90 days)
    Repository access Select Only select repositoriesdt-lookml
    Permissions Under Repository permissions, set Contents to Read and write
  4. Click Generate token

  5. Copy the token immediately — you will not be able to see it again

⚠️ Important: Treat this token like a password. Do not share it or commit it to any repository.


Step 2: Configure User Attributes in Looker

  1. Log in to Looker

  2. Click your profile picture (top right) → Account

  3. Scroll down to the User Attributes section

  4. Fill in the following attributes:

    Attribute Value
    github_username Your GitHub username
    github_token The PAT you created in Step 1
  5. Click Save


Verification

After completing these steps, any commits you make through Looker will be attributed to your GitHub account. You can verify this by:

  1. Making a change in Looker's IDE
  2. Committing and pushing to a branch
  3. Checking the commit history on GitHub — it should show your username as the author

Token Renewal

Personal Access Tokens expire based on the expiration date you set. When your token expires:

  1. Create a new token following Step 1
  2. Update the github_token user attribute in Looker following Step 2

Consider setting a calendar reminder before your token expires.