{"id":20936911,"url":"https://github.com/datafold/public-api-demos","last_synced_at":"2025-03-13T03:11:54.995Z","repository":{"id":198265967,"uuid":"700457023","full_name":"datafold/public-api-demos","owner":"datafold","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-22T00:26:21.000Z","size":26,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T20:17:26.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datafold.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-04T16:22:38.000Z","updated_at":"2023-10-04T16:55:11.000Z","dependencies_parsed_at":"2023-11-22T02:10:38.309Z","dependency_job_id":null,"html_url":"https://github.com/datafold/public-api-demos","commit_stats":null,"previous_names":["datafold/public-api-demos"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datafold%2Fpublic-api-demos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datafold%2Fpublic-api-demos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datafold%2Fpublic-api-demos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datafold%2Fpublic-api-demos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datafold","download_url":"https://codeload.github.com/datafold/public-api-demos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243330325,"owners_count":20274039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T22:29:55.796Z","updated_at":"2025-03-13T03:11:54.975Z","avatar_url":"https://github.com/datafold.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# public-api-demos\n\n## Description\nDemo to show how to use the Datafold API to run data diffs in CI pipelines in all kinds of ways.\n\n\n## Example 1: Running Datafold Cloud in a Jenkins Pipeline\n\n### Tech Stack\n- dbt Cloud\n- BigQuery\n- Datafold\n- python 3.9.6\n- Jenkins (as reference)\n\n### Run Locally\n\n```shell\n# setup python venv\npip install --upgrade pip\npython -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\nsource venv/bin/activate\n\n# test in a personal repo, this example will not work automatically unless you have a GCP service account\ngit clone https://github.com/sungchun12/dbt_bigquery_example.git\ncd dbt_bigquery_example\ngit checkout demo/bigquery-pr\n```\n\n```yaml\n# add these Datafold configs to your `dbt_project.yml`\nvars:\n  data_diff:\n    datasource_id: 6575 # found in the Datafold Data Sources Settings Page\n```\n\n```shell\n# export env vars for a local run, few examples below\n# you'll inject these in the jenkins file, these are exported locally for testing\nexport DBT_CLOUD_PRODUCTION_JOB_ID=\u003cyour_dbt_cloud_job_id\u003e\nexport DATAFOLD_API_KEY=\u003cyour_datafold_api_key\u003e\nexport DBT_CLOUD_API_TOKEN=\u003cyour_dbt_cloud_api_token\u003e\nexport DATA_SOURCE_ID=\u003cyour_data_source_id\u003e\n```\n\n```shell\n# run the script\npython ../datafold_ci.py\n\n# output example\nGetting latest job run artifacts [manifest.json] for job id: 428271\n    File written to: /Users/sung/api-demo/dbt_bigquery_example/manifest.json\nGetting latest job run artifacts [run_results.json] for job id: 428275\n    File written to: /Users/sung/api-demo/dbt_bigquery_example/target/run_results.json\nGetting latest job run artifacts [manifest.json] for job id: 428275\n    File written to: /Users/sung/api-demo/dbt_bigquery_example/target/manifest.json\nRunning with data-diff=0.8.4 (Update 0.9.1 is available!)\nCloud datafold host: https://app.datafold.com\nSaving the API key to the system keyring service\n\nDiffs in progress...\n\n\ndbt-demo-386220.dbt_sung_prod.order_payments \u003c\u003e \ndbt-demo-386220.dbt_cloud_pr_ALPHANUMERIC_CHANGE_BRANCH_CHANGE_ID_BUILD_NUMBER_428275.order_payments \nSkipped due to unknown primary key. Add uniqueness tests, meta, or tags.\n\nfct_orders: https://app.datafold.com/datadiffs/2262836/overview\nstg_orders: https://app.datafold.com/datadiffs/2262837/overview\nstg_payments: https://app.datafold.com/datadiffs/2262838/overview\n\ndbt-demo-386220.dbt_sung_prod.fct_orders \u003c\u003e \ndbt-demo-386220.dbt_cloud_pr_ALPHANUMERIC_CHANGE_BRANCH_CHANGE_ID_BUILD_NUMBER_428275.fct_orders \nColumn(s) added: ['new_column']\n\nhttps://app.datafold.com/datadiffs/2262836/overview\n \n  Rows Added    Rows Removed\n------------  --------------\n          10               0\n\nUpdated Rows: 0\nUnchanged Rows: 10\n\nValue Match Percent: \n\n\ndbt-demo-386220.dbt_sung_prod.stg_orders \u003c\u003e \ndbt-demo-386220.dbt_cloud_pr_ALPHANUMERIC_CHANGE_BRANCH_CHANGE_ID_BUILD_NUMBER_428275.stg_orders \n\nhttps://app.datafold.com/datadiffs/2262837/overview\nNo row differences\n\n\n\ndbt-demo-386220.dbt_sung_prod.stg_payments \u003c\u003e \ndbt-demo-386220.dbt_cloud_pr_ALPHANUMERIC_CHANGE_BRANCH_CHANGE_ID_BUILD_NUMBER_428275.stg_payments \n\nhttps://app.datafold.com/datadiffs/2262838/overview\nNo row differences\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatafold%2Fpublic-api-demos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatafold%2Fpublic-api-demos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatafold%2Fpublic-api-demos/lists"}