Package: gooddata-dbt
gooddata-dbtGoodData plugin for dbt. Reads dbt models and profiles, generates GoodData semantic model.Installpipinstallgooddata-dbt# Or add the corresponding line to requirements.txt# Or install specific versionpipinstallgooddata-dbt==1.0.0You can also install optional dependencies:# To allow sending comments to GitHub pull requestspipinstallPyGithub# To allow automatic translation of GoodData metadatapipinstalldeep-translatorConfiguration, parametrizationCreategooddata.yamlfile to configure so-called data products and environments.
Checkgooddata_example.ymlfile for more details.Parametrization of each execution can be done using environment variables / tool arguments.
Use main --help and --help for each use case to learn more.Alternatively, you can configure everything with environment variables.
You can directly set env variables in a shell session, or store them to .env file(s).
We provide the following example:.env.dev.env.custom.devis loaded from the above file and contains sensitive variables.
Add.env.custom.*to .gitignore!Then load .env files:source.env.localUse casesgooddata-dbt--helpThe plugin provides the following use cases:provision_workspacesProvisions workspaces to GoodData based on gooddata.yaml fileregister_data_sourcesRegisters data source in GoodData for each relevant dbt profiledeploy_ldmReads dbt models and profilesScans data source (connection props from dbt profiles) through GoodData to get column data types (optional in dbt)Generates GoodData LDM(Logical Data Model) from dbt models. Can utilize custom gooddata-specific metadata, more belowupload_notificationInvalidates caches for data sourcedeploy_analyticsReads content ofgooddata_layoutfolder and deploys analytics model to GoodDatastore_analyticsReads analytics model from GoodData instance and stores it to disk togooddata_layoutfoldertest_insightsLists all insights(reports) from GoodData instance, and executes each report to validate itdbt_cloudRuns dbt cloud job through their API. Alternative to running dbt-core locally.If running in CI pipeline, it can also notify about performance degradations in a form of GitHub/Gitlab comment.dbt_cloud_statsEsp. for testing purposes. It's triggered from dbt_cloud as well. It collects stats and reports perf degradations.Check.env.dev/.env.custom.devfiles for how to set related env variables.Custom metadata in dbt models (optional)If you want to generate optimal LDM from dbt models, sometimes you need to specify semantic metadata in dbt models.In general, all GoodData metadata must be put to dbt models undermetakey, except descriptions.Titles, descriptionsdbt supports onlydescriptionfield. For now, gooddata-dbt generates GoodData title/description from dbt description.Can be specified for both tables and columns.Model IDPer table, you can specifymodel_id. When deploying models/analytics, you can include any subset of model_ids.models:-name:xxxmeta:gooddata:model_id:my_idGoodData entitiesBy default, gooddata-dbt generates GoodData entities based on the following rules:data type = NUMERIC (decimal number) - factdata_type = DATE/TIMESTAMP/TIMESTAMPTZ - date dimensionother data types = attributesTo override the default, specify custom GoodData meta this way:columns:-name:xxxxmeta:gooddata:ldm_type:fact/attribute/label/date/reference/primary_keyreferenced_table:<table name, target of reference (FK), if ldm_type=reference>label_type:TEXT/HYPERLINK/GEO_LATITUDE/GEO_LONGITUDEattribute_column:<column name of attribute of label, if ldm_type=label>sort_column:"<anycolumninthesametable,maynotbeexposedasLDMobject>"sort_direction:"DESC"# Only for labels, this label will be displayed by default in reportsdefault_view:true