Skip to content

Commit

Permalink
Use dbt Flags (#69)
Browse files Browse the repository at this point in the history
* Use dbt Flags

Signed-off-by: Yu Ishikawa <[email protected]>

* Don't support dbt 1.5 or below

Signed-off-by: Yu Ishikawa <[email protected]>

* Edit README

Signed-off-by: Yu Ishikawa <[email protected]>

* Fix

Signed-off-by: Yu Ishikawa <[email protected]>

---------

Signed-off-by: Yu Ishikawa <[email protected]>
  • Loading branch information
yu-iskw authored May 29, 2024
1 parent e882e53 commit 8d3dfbe
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 75 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,57 +16,25 @@ jobs:
matrix:
include:
# Python 3.8
- python-version: "3.8"
pip-requirements: "requirements-1.1.txt"
- python-version: "3.8"
pip-requirements: "requirements-1.2.txt"
- python-version: "3.8"
pip-requirements: "requirements-1.3.txt"
- python-version: "3.8"
pip-requirements: "requirements-1.4.txt"
- python-version: "3.8"
pip-requirements: "requirements-1.5.txt"
- python-version: "3.8"
pip-requirements: "requirements-1.6.txt"
- python-version: "3.8"
pip-requirements: "requirements-1.7.txt"
# Python 3.9
- python-version: "3.9"
pip-requirements: "requirements-1.1.txt"
- python-version: "3.9"
pip-requirements: "requirements-1.2.txt"
- python-version: "3.9"
pip-requirements: "requirements-1.3.txt"
- python-version: "3.9"
pip-requirements: "requirements-1.4.txt"
- python-version: "3.9"
pip-requirements: "requirements-1.5.txt"
- python-version: "3.9"
pip-requirements: "requirements-1.6.txt"
- python-version: "3.9"
pip-requirements: "requirements-1.7.txt"
- python-version: "3.8"
pip-requirements: "requirements-1.8.txt"
# Python 3.10
- python-version: "3.10"
pip-requirements: "requirements-1.1.txt"
- python-version: "3.10"
pip-requirements: "requirements-1.2.txt"
- python-version: "3.10"
pip-requirements: "requirements-1.3.txt"
- python-version: "3.10"
pip-requirements: "requirements-1.4.txt"
- python-version: "3.10"
pip-requirements: "requirements-1.5.txt"
- python-version: "3.10"
pip-requirements: "requirements-1.6.txt"
- python-version: "3.10"
pip-requirements: "requirements-1.7.txt"
- python-version: "3.10"
pip-requirements: "requirements-1.8.txt"
# Python 3.11
- python-version: "3.11"
pip-requirements: "requirements-1.5.txt"
- python-version: "3.11"
pip-requirements: "requirements-1.6.txt"
- python-version: "3.11"
Expand Down
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# dbt-data-privacy

This dbt package enables us to protect out customers' privacy on warehouse.

<!-- toc -->
Expand All @@ -7,24 +8,27 @@ This dbt package enables us to protect out customers' privacy on warehouse.
- [Requirements](#requirements)
- [Supported warehouses](#supported-warehouses)
- [Generic tests](#generic-tests)
* [Data Loss Prevention](#data-loss-prevention)
- [Data Loss Prevention](#data-loss-prevention)
- [Macros](#macros)
* [Pseudonymization](#pseudonymization)
+ [`sha256`](#sha256)
+ [`sha512`](#sha512)
+ [`extract_email_domain`](#extract_email_domain)
* [Code generation](#code-generation)
+ [`generate_privacy_protected_models`](#generate_privacy_protected_models)
- [Pseudonymization](#pseudonymization)
- [`sha256`](#sha256)
- [`sha512`](#sha512)
- [`extract_email_domain`](#extract_email_domain)
- [Code generation](#code-generation)
- [`generate_privacy_protected_models`](#generate_privacy_protected_models)

<!-- tocstop -->

## Installation Instructions

COMING SOON

## Requirements
- dbt-core: 1.1.0 or later

- dbt-core: 1.6 or later

## Supported warehouses

We support only BigQuery at the moment.
But, the implementation can be extended to other warehouses by following the manner of dbt package development.

Expand All @@ -33,38 +37,46 @@ But, the implementation can be extended to other warehouses by following the man
## Generic tests

### Data Loss Prevention

COMING SOON

## Macros

### Pseudonymization

#### `sha256`
Computes the hash of the input using the SHA-256 algorithm.

Computes the hash of the input using the SHA-256 algorithm.

**Usage:**

```yaml
SELECT
{{ dbt_data_privacy.sha256("column_a") }} AS column_a,
```

#### `sha512`
Computes the hash of the input using the SHA-512 algorithm.

Computes the hash of the input using the SHA-512 algorithm.

**Usage:**

```yaml
SELECT
{{ dbt_data_privacy.sha512("column_a") }} AS column_a,
```

#### `extract_email_domain`

Computes the hash of the input using the SHA-512 algorithm.

**Usage:**

```yaml
SELECT
{{ dbt_data_privacy.extract_email_domain("email_column") }} AS email_column,
```

### Code generation

[Generate privacy-protected dbt models](./docs/generate_models.md)
2 changes: 1 addition & 1 deletion integration_tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
setup:
pip install --force-reinstall -r requirements/requirements-1.7.txt
pip install --force-reinstall -r requirements/requirements-1.8.txt
dbt deps --profiles-dir profiles --target bigquery


Expand Down
8 changes: 8 additions & 0 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@ clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_modules"

flags:
send_anonymous_usage_stats: false
use_colors: true
warn_error_options:
silence:
- ProjectFlagsMovedDeprecation


models:
5 changes: 0 additions & 5 deletions integration_tests/profiles/profiles.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
---
config:
send_anonymous_usage_stats: false
use_colors: true

default:
outputs:
bigquery:
Expand Down
11 changes: 0 additions & 11 deletions integration_tests/requirements/requirements-1.1.txt

This file was deleted.

4 changes: 0 additions & 4 deletions integration_tests/requirements/requirements-1.2.txt

This file was deleted.

4 changes: 0 additions & 4 deletions integration_tests/requirements/requirements-1.3.txt

This file was deleted.

4 changes: 0 additions & 4 deletions integration_tests/requirements/requirements-1.4.txt

This file was deleted.

4 changes: 0 additions & 4 deletions integration_tests/requirements/requirements-1.5.txt

This file was deleted.

0 comments on commit 8d3dfbe

Please sign in to comment.