diff --git a/README.rst b/README.rst index 7e59139dc..f538c0cbc 100644 --- a/README.rst +++ b/README.rst @@ -190,6 +190,22 @@ Available languages are stored in a mapping, and so best edited directly in Tuto Where the first key is the abbreviation of the language to use, "flag" is which flag icon is displayed in the user interface for choosing the language, and "name" is the displayed name for that language. The mapping above shows all of the current languages supported by Superset, but please note that different languages have different levels of completion and support at this time. + +Extending the DBT project +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To extend the DBT project there are multiple options: + + #. DBT_REPOSITORY: A git repository URL to the DBT project + #. DBT_BRANCH: A git branch to use for the DBT project + #. DBT_REPOSITORY_PATH: A path to the DBT project in the git repository + #. EXTRA_DBT_PACKAGES: A list of python packages necessary for the DBT project + #. DBT_ENABLE_OVERRIDE: A boolean to enable/disable the DBT project override, those overrides + allows you to extend the DBT project without having to fork it. For this to work you need + to create a patch with the name ``dbt-packages`` and ``dbt-project``. We recommend to copy + the default DBT files (``dbt_project.yml`` and ``packages.yml``) and add your changes from + there. + License ------- diff --git a/tutoraspects/plugin.py b/tutoraspects/plugin.py index cad6597a4..2f6c9259a 100644 --- a/tutoraspects/plugin.py +++ b/tutoraspects/plugin.py @@ -224,6 +224,7 @@ ("DBT_PROFILE_SYNC_REQUEST_TIMEOUT", "5"), # Compression block size if compression is enabled, this is the default value ("DBT_PROFILE_COMPRESS_BLOCK_SIZE", "1048576"), + ("DBT_ENABLE_OVERRIDE", False), ] ) diff --git a/tutoraspects/templates/aspects/apps/aspects/dbt/dbt_project.yml b/tutoraspects/templates/aspects/apps/aspects/dbt/dbt_project.yml new file mode 100644 index 000000000..1b93e0576 --- /dev/null +++ b/tutoraspects/templates/aspects/apps/aspects/dbt/dbt_project.yml @@ -0,0 +1 @@ +{{ patch("dbt-project") }} diff --git a/tutoraspects/templates/aspects/apps/aspects/dbt/packages.yml b/tutoraspects/templates/aspects/apps/aspects/dbt/packages.yml new file mode 100644 index 000000000..ab099d53b --- /dev/null +++ b/tutoraspects/templates/aspects/apps/aspects/dbt/packages.yml @@ -0,0 +1 @@ +{{ patch("dbt-packages") }} diff --git a/tutoraspects/templates/aspects/apps/aspects/scripts/dbt.sh b/tutoraspects/templates/aspects/apps/aspects/scripts/dbt.sh index a47ef99f4..4244a48b4 100644 --- a/tutoraspects/templates/aspects/apps/aspects/scripts/dbt.sh +++ b/tutoraspects/templates/aspects/apps/aspects/scripts/dbt.sh @@ -12,6 +12,14 @@ git clone -b {{ DBT_BRANCH }} {{ DBT_REPOSITORY }} cd {{ DBT_REPOSITORY_PATH }} || exit +{% if DBT_ENABLE_OVERRIDE %} +echo /app/aspects/dbt/packages.yml > packages.yml +echo /app/aspects/dbt/dbt_project.yml > dbt_project.yml + +cat {{ DBT_REPOSITORY_PATH }}/packages.yml +cat {{ DBT_REPOSITORY_PATH }}/dbt_project.yml +{% endif %} + echo "Installing dbt dependencies" dbt deps --profiles-dir /app/aspects/dbt/