tnightengale / dbt-activity-schema

A dbt-Core package for generating models from an activity stream.
GNU General Public License v3.0
38 stars 5 forks source link

Activity Stream Utilities #31

Open bcodell opened 1 year ago

bcodell commented 1 year ago

Description

This package should contain utilities to help users build Activity Stream models.

Requirements

The following features need to be supported:

The following functionality is optional but would be beneficial:

Implementation

Components

I'm proposing the following updates:

Expanding the dbt_project.yml config to take an optional skip_activity_stream parameter - a boolean that defaults to false - that is used to determine if Activity Stream models should be built in the project, or if Datasets should query Activity models directly.

Expanding the dbt_project.yml config to register the name of each activity stream contained in the project, with nested attributes for each stream to specify which standard Activity Schema columns are included in the stream itself, if that stream should be built or skipped (overrides global setting), and aliases for standard Activity Schema column names specific to that stream (overrides globally defined aliases in column_mappings attribute).

A build_activity_stream macro that does the following:

A macro called union_activities that does the following:

A macro called drop_activity that does the following:

A macro called insert_activity that does the following:

A refactor of the dataset macro to query Activities models directly in a non-production environment (likely using dbt targets)

A refactor of the dataset macro to query Activities models directly if the skip_activity_stream project config parameter is set to true

Deployment Plan

I'm proposing the following multi-step deployment plan for the above in order to break up the work into reasonable chunks and make useful new features available faster:

Dependencies

25 - Activity Registry

Open Questions