From 98f45b7b24af7e6eba6b7425247b1ef7f2af0f7a Mon Sep 17 00:00:00 2001 From: "apietrobon@ona.io" Date: Thu, 8 Dec 2022 12:47:46 +0000 Subject: [PATCH 1/2] package details --- dbt_project.yml | 19 ++++++------------- macros/normalize_onadata_form.sql | 6 +++++- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index d713296..5746e21 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -2,10 +2,12 @@ # 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' @@ -13,16 +15,7 @@ profile: 'default' # 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" @@ -30,13 +23,13 @@ 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 diff --git a/macros/normalize_onadata_form.sql b/macros/normalize_onadata_form.sql index d3c8a48..3d61a74 100644 --- a/macros/normalize_onadata_form.sql +++ b/macros/normalize_onadata_form.sql @@ -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", From 974180fb4ea95277f4a7df020e06d5d45c4fe6b7 Mon Sep 17 00:00:00 2001 From: "apietrobon@ona.io" Date: Thu, 8 Dec 2022 12:54:55 +0000 Subject: [PATCH 2/2] packages update --- packages.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 packages.yml diff --git a/packages.yml b/packages.yml new file mode 100644 index 0000000..426be12 --- /dev/null +++ b/packages.yml @@ -0,0 +1,3 @@ +packages: + - package: dbt-labs/dbt_utils + version: 1.0.0