Skip to content

Commit

Permalink
Merge pull request #3 from onaio/ale_utils
Browse files Browse the repository at this point in the history
Ale utils
  • Loading branch information
alepietrobon authored Dec 8, 2022
2 parents 372d55f + 008d9fe commit d206d9e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
19 changes: 6 additions & 13 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,34 @@
# Name your project! Project names should contain only lowercase characters
# and underscores. A good package name should reflect your organization's
# name or the intended use of these models
name: 'my_new_project'
version: '1.0.0'
name: 'ona_utils'
version: '0.1.0'
config-version: 2

require-dbt-version: [">=1.0.0"]

# This setting configures which "profile" dbt uses for this project.
profile: 'default'

# These configurations specify where dbt should look for different types of files.
# The `source-paths` config, for example, states that models in this project can be
# found in the "models/" directory. You probably won't need to change these!
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]

target-path: "target" # directory which will store compiled SQL files
clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"



vars:
# the 'connector_table_name' variable is a default that will be accessible throughout the project, and can be overridden in the dbt run command
connector_table_name: 'form_data'
# the 'connector_schema_name' variable is a default that will be accessible throughout the project, and can be overridden in the dbt run command
connector_schema_name: 'inform'
connector_schema_name: 'onadata'

# Configuring models
# Full documentation: https://docs.getdbt.com/docs/configuring-models

models:
my_new_project:
ona_utils:
# Applies to all files under models/onadata_connector/
onadata_connector:
materialized: table
6 changes: 5 additions & 1 deletion macros/normalize_onadata_form.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{# Macro takes an airbyte JSON string containing the details of an onadata submission and outputs the SQL to generate a table for each of the keys #}
{# Optional arguments includes a list of metadata field (exclusion list) that are usually not necessary to port over #}
{#-- 2022.12.05 AP. This is a V1 version--#}
{#-- 2022.12.05 AP. This is a V1 version. Limitations include:
- All data is stored as text (?)
- No lables, no direct link with the table schema
- No optimization by database
- several others that will come to mind :) --#}

{% macro normalize_onadata_form(
schema_name="airbyte",
Expand Down
3 changes: 3 additions & 0 deletions packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages:
- package: dbt-labs/dbt_utils
version: 1.0.0

0 comments on commit d206d9e

Please sign in to comment.