Hashboard pull command

The pull command is a utility for getting resource configuration files from the web UI to a local workspace. You can use it to migrate resources to a code-based workflow. If you already have local files that correspond with Hashboard resources, hb pull will update the local versions of those files.

Updating resources and dev workflow

The default behavior of pull is to only update resources that were created through the Hashboard CLI (i.e. any hb command).

For example: let's say you originally built four models with the CLI and another two models in the UI. If you run hb pull from an empty directory, you'll only pull those four model files. You won't get the two UI-built models, or any additional resources built in the UI for that matter.

pull resources originally built in the UI

You can also pull resources that were not built with the CLI. If you want to pull down a resource that was built in the UI, you have two options:

1. Pull all resources

You can use the --all flag to get every single Hashboard resource regardless of whether it was created with the CLI.

hb pull --all

2. Pull a specific resource with a GRN

You can pull down a specific resource by its Global Resource Name.

# pull by a specific grn
hb pull m:s3AdinvBhsdJ:
 
# alternatively, pull by alias
hb pull m::my_sales_model

Config format used in pull

hb pull uses the most verbose (and specific) possible format of a resource. Some configuration that is just defaulted or configured by Hashboard will be exported.

For example: if you export a resource, it will default to being exported with a pinned GRN. You can remove the GRN to enable deploying the resource across different projects (or use an alias so that the resource is not bound to a specific instance in a single project).

dbt models and the pull command

You can pull Hashboard model definitions directly into your dbt files using the --include-dbt flag. If this flag is omitted the hb pull command will skip any models that were defined using the dbt integration by default.

# pull all resources controlled by code including dbt models
hb pull --include-dbt
 
# pull a single dbt model with either an alias or id
hb pull m:s3AdinvBhsdJ --include-dbt
hb pull m::my_sales_model --include-dbt

This will update the Hashboard metadata directly in your dbt properties yml files.

  models:
    - name: sales
      description: sales has a record for each customer, order, product combination
      columns:
        - name: ORDERDATE
          description: the date of the order
+         meta:
+           hashboard:
+           primaryDate: true
        - name: ORDERNUMBER
        - name: PRODUCTCODE
          description: Unique code
+         meta:
+           hashboard:
+             foreignModels:
+               - m::products
        - name: CUSTOMERNAME
+     meta:
+       hashboard:
+         alias: sales
+         cols:
+           - id: unique_products
+             type: metric
+             name: unique products
+             aggregate: count_distinct
+             physicalName: PRODUCTCODE