dq-export-connector 0.1.0.dev34__tar.gz → 0.1.0.dev36__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. dq_export_connector-0.1.0.dev36/.gitignore +63 -0
  2. dq_export_connector-0.1.0.dev36/PKG-INFO +100 -0
  3. dq_export_connector-0.1.0.dev36/README.md +79 -0
  4. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/_models/export_connector_credentials.py +89 -11
  5. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/_models/export_receipt.py +235 -61
  6. dq_export_connector-0.1.0.dev36/dq_export_connector/_models/export_worker_config.py +571 -0
  7. dq_export_connector-0.1.0.dev36/dq_export_connector/adform/export.py +123 -0
  8. dq_export_connector-0.1.0.dev36/dq_export_connector/audience/export.py +75 -0
  9. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/audience/identifiers.py +2 -0
  10. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/audience/sync.py +13 -9
  11. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/bucket/validate.py +5 -1
  12. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/errors.py +34 -12
  13. dq_export_connector-0.1.0.dev36/dq_export_connector/files/export.py +161 -0
  14. dq_export_connector-0.1.0.dev36/dq_export_connector/files/naming.py +30 -0
  15. dq_export_connector-0.1.0.dev36/dq_export_connector/google_ad_manager/export.py +103 -0
  16. dq_export_connector-0.1.0.dev36/dq_export_connector/google_ad_manager/store.py +64 -0
  17. dq_export_connector-0.1.0.dev36/dq_export_connector/google_auth.py +154 -0
  18. dq_export_connector-0.1.0.dev36/dq_export_connector/google_dv360/__init__.py +0 -0
  19. dq_export_connector-0.1.0.dev36/dq_export_connector/google_dv360/clients.py +55 -0
  20. dq_export_connector-0.1.0.dev36/dq_export_connector/google_dv360/destination.py +213 -0
  21. dq_export_connector-0.1.0.dev36/dq_export_connector/google_dv360/export.py +83 -0
  22. dq_export_connector-0.1.0.dev36/dq_export_connector/google_dv360/validate.py +82 -0
  23. dq_export_connector-0.1.0.dev36/dq_export_connector/google_oauth.py +7 -0
  24. dq_export_connector-0.1.0.dev36/dq_export_connector/meta/__init__.py +0 -0
  25. dq_export_connector-0.1.0.dev36/dq_export_connector/meta/client.py +292 -0
  26. dq_export_connector-0.1.0.dev36/dq_export_connector/meta/destination.py +216 -0
  27. dq_export_connector-0.1.0.dev36/dq_export_connector/meta/export.py +69 -0
  28. dq_export_connector-0.1.0.dev36/dq_export_connector/meta/validate.py +39 -0
  29. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/models/__init__.py +15 -1
  30. dq_export_connector-0.1.0.dev36/dq_export_connector/models/adform.py +33 -0
  31. dq_export_connector-0.1.0.dev36/dq_export_connector/models/audience.py +8 -0
  32. dq_export_connector-0.1.0.dev36/dq_export_connector/models/google.py +9 -0
  33. dq_export_connector-0.1.0.dev36/dq_export_connector/models/google_ad_manager.py +38 -0
  34. dq_export_connector-0.1.0.dev36/dq_export_connector/models/google_dv360.py +27 -0
  35. dq_export_connector-0.1.0.dev36/dq_export_connector/models/meta.py +35 -0
  36. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/oauth.py +20 -13
  37. dq_export_connector-0.1.0.dev36/dq_export_connector/redact.py +78 -0
  38. dq_export_connector-0.1.0.dev36/dq_export_connector/runner.py +404 -0
  39. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/pyproject.toml +16 -9
  40. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/scripts/codegen-models.sh +3 -1
  41. dq_export_connector-0.1.0.dev36/tests/__init__.py +0 -0
  42. dq_export_connector-0.1.0.dev36/tests/fakes/__init__.py +0 -0
  43. dq_export_connector-0.1.0.dev36/tests/fakes/google_dv360_fake.py +118 -0
  44. dq_export_connector-0.1.0.dev36/tests/fakes/meta_fake.py +143 -0
  45. dq_export_connector-0.1.0.dev36/tests/support.py +105 -0
  46. dq_export_connector-0.1.0.dev36/tests/test_file_kinds_runner.py +278 -0
  47. dq_export_connector-0.1.0.dev36/tests/test_google_dv360_runner.py +301 -0
  48. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/tests/test_identifiers_and_inputs.py +43 -9
  49. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/tests/test_live_buckets.py +4 -2
  50. dq_export_connector-0.1.0.dev36/tests/test_live_file_kinds.py +106 -0
  51. dq_export_connector-0.1.0.dev36/tests/test_live_google_dv360.py +93 -0
  52. dq_export_connector-0.1.0.dev36/tests/test_live_meta.py +76 -0
  53. dq_export_connector-0.1.0.dev36/tests/test_meta_runner.py +316 -0
  54. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/tests/test_oauth.py +23 -21
  55. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/tests/test_redact.py +0 -5
  56. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/tests/test_runner.py +2 -0
  57. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/tests/test_sync_input.py +4 -3
  58. dq_export_connector-0.1.0.dev36/uv.lock +1773 -0
  59. dq_export_connector-0.1.0.dev34/.gitignore +0 -5
  60. dq_export_connector-0.1.0.dev34/PKG-INFO +0 -158
  61. dq_export_connector-0.1.0.dev34/README.md +0 -145
  62. dq_export_connector-0.1.0.dev34/dq_export_connector/_models/export_worker_config.py +0 -303
  63. dq_export_connector-0.1.0.dev34/dq_export_connector/audience/classify.py +0 -81
  64. dq_export_connector-0.1.0.dev34/dq_export_connector/audience/http.py +0 -237
  65. dq_export_connector-0.1.0.dev34/dq_export_connector/models/snap.py +0 -48
  66. dq_export_connector-0.1.0.dev34/dq_export_connector/redact.py +0 -128
  67. dq_export_connector-0.1.0.dev34/dq_export_connector/runner.py +0 -263
  68. dq_export_connector-0.1.0.dev34/dq_export_connector/snap/accounts.py +0 -18
  69. dq_export_connector-0.1.0.dev34/dq_export_connector/snap/client.py +0 -169
  70. dq_export_connector-0.1.0.dev34/dq_export_connector/snap/destination.py +0 -118
  71. dq_export_connector-0.1.0.dev34/dq_export_connector/snap/export.py +0 -127
  72. dq_export_connector-0.1.0.dev34/dq_export_connector/snap/session.py +0 -103
  73. dq_export_connector-0.1.0.dev34/dq_export_connector/snap/validate.py +0 -29
  74. dq_export_connector-0.1.0.dev34/scripts/_local.py +0 -115
  75. dq_export_connector-0.1.0.dev34/scripts/run_local.py +0 -54
  76. dq_export_connector-0.1.0.dev34/tests/conftest.py +0 -37
  77. dq_export_connector-0.1.0.dev34/tests/fakes/snap_fake.py +0 -285
  78. dq_export_connector-0.1.0.dev34/tests/test_http_and_oauth.py +0 -359
  79. dq_export_connector-0.1.0.dev34/tests/test_live_snap.py +0 -137
  80. dq_export_connector-0.1.0.dev34/tests/test_scripts.py +0 -22
  81. dq_export_connector-0.1.0.dev34/tests/test_snap_runner.py +0 -652
  82. dq_export_connector-0.1.0.dev34/uv.lock +0 -721
  83. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/.python-version +0 -0
  84. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/__init__.py +0 -0
  85. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/_models/__init__.py +0 -0
  86. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/_models/application_error.py +0 -0
  87. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/_models/application_warning.py +0 -0
  88. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/_models/destination_account_listing.py +0 -0
  89. {dq_export_connector-0.1.0.dev34/dq_export_connector/audience → dq_export_connector-0.1.0.dev36/dq_export_connector/adform}/__init__.py +0 -0
  90. {dq_export_connector-0.1.0.dev34/dq_export_connector/bucket → dq_export_connector-0.1.0.dev36/dq_export_connector/audience}/__init__.py +0 -0
  91. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/audience/inputs.py +0 -0
  92. {dq_export_connector-0.1.0.dev34/dq_export_connector/snap → dq_export_connector-0.1.0.dev36/dq_export_connector/bucket}/__init__.py +0 -0
  93. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/bucket/export.py +0 -0
  94. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/bucket/paths.py +0 -0
  95. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/bucket/store.py +0 -0
  96. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/bucket/upload.py +0 -0
  97. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/datasets.py +0 -0
  98. {dq_export_connector-0.1.0.dev34/tests → dq_export_connector-0.1.0.dev36/dq_export_connector/files}/__init__.py +0 -0
  99. {dq_export_connector-0.1.0.dev34/tests/fakes → dq_export_connector-0.1.0.dev36/dq_export_connector/google_ad_manager}/__init__.py +0 -0
  100. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/log.py +0 -0
  101. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/models/bucket.py +0 -0
  102. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/dq_export_connector/outcome.py +0 -0
  103. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/tests/test_models_are_current.py +0 -0
  104. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/tests/test_paths.py +0 -0
  105. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/tests/test_store.py +0 -0
  106. {dq_export_connector-0.1.0.dev34 → dq_export_connector-0.1.0.dev36}/tests/test_upload.py +0 -0
@@ -0,0 +1,63 @@
1
+ .DS_Store
2
+ **/build/
3
+ .idea/
4
+ .vscode/*
5
+ !.vscode/tasks.json
6
+ target/
7
+ node_modules/
8
+ result
9
+ /result-*
10
+ **/*.o
11
+ env
12
+ venv
13
+ .venv
14
+ .direnv
15
+ **/perf.data*
16
+ infra/packages/hadoop/binary.tar.gz
17
+ .terraform
18
+ config.tf.json
19
+ *.tfstate.*
20
+ *.tfstate
21
+ **/.deploy-gc
22
+ .vagrant
23
+ .pnpm-debug.log
24
+ .yarn
25
+ __pycache__
26
+ trusted/dcr-compiler/ddc/src/data_lab/**/*.png
27
+ trusted/dcr-compiler/ddc/src/data_lab/**/*.json
28
+ e2e-tests/frontend/confidence-check-config.json
29
+ .terraform.lock.hcl
30
+ dmp/analysis-scripts/results/*
31
+ .env
32
+ !tools/dqdev/internal/target/
33
+ docusaurus/style-guide.md
34
+ **/.claude/settings.local.json
35
+ **/.claude/agent-memory-local/
36
+ .claude/*.lock
37
+ .claude/worktrees/
38
+ **/CLAUDE.local.md
39
+ **/*.parquet/**
40
+ .pnpm-store/
41
+ .turbo/
42
+
43
+ # Agentic-coding workflow (local, not part of this repo)
44
+ .workflow/
45
+ .workflow-backup-*
46
+
47
+ # Local-only Google Ads/DV360 test scripts (kept out of the PR)
48
+ dmp/dqdmp/scripts/
49
+
50
+ # Playwright MCP screenshots (local only)
51
+ .playwright-mcp/
52
+
53
+ # Claude Design sync build artifacts (local only).
54
+ **/.design-sync/sb-reference/
55
+ **/.design-sync/learnings/
56
+ **/.design-sync/.cache/
57
+ **/.design-sync/node_modules
58
+ .ds-sync/
59
+ ds-bundle/
60
+
61
+ # DMP creation-prefill tests (local only)
62
+ avato-backend/frontend/decentriq-platform/src/features/dmp/models/creationPrefill.test.ts
63
+ avato-backend/frontend/decentriq-platform/src/features/dmp/utils/creationPrefill/*.test.ts
@@ -0,0 +1,100 @@
1
+ Metadata-Version: 2.5
2
+ Name: dq-export-connector
3
+ Version: 0.1.0.dev36
4
+ Summary: Worker logic for the Export Connector DCR.
5
+ Author: Decentriq
6
+ Requires-Python: >=3.12
7
+ Requires-Dist: pydantic<3,>=2.14
8
+ Provides-Extra: adform
9
+ Requires-Dist: obstore<0.12,>=0.11.1; extra == 'adform'
10
+ Provides-Extra: bucket
11
+ Requires-Dist: obstore<0.12,>=0.11.1; extra == 'bucket'
12
+ Provides-Extra: google-ad-manager
13
+ Requires-Dist: obstore<0.12,>=0.11.1; extra == 'google-ad-manager'
14
+ Provides-Extra: google-dv360
15
+ Requires-Dist: google-ads-datamanager<0.10,>=0.9.5; extra == 'google-dv360'
16
+ Requires-Dist: google-auth<3,>=2.63; extra == 'google-dv360'
17
+ Requires-Dist: requests<3,>=2.32; extra == 'google-dv360'
18
+ Provides-Extra: meta
19
+ Requires-Dist: facebook-business<28,>=27.0.1; extra == 'meta'
20
+ Description-Content-Type: text/markdown
21
+
22
+ # dq-export-connector
23
+
24
+ Worker logic for the **Export Connector DCR**: one package for every
25
+ Connector Kind, each in its own sub-package with an extra of the same name for
26
+ its dependencies:
27
+
28
+ | Kind | Extra | What a run does | Through |
29
+ | --- | --- | --- | --- |
30
+ | Bucket | `bucket` | Uploads each Input's dataset to S3, Azure Blob or GCS | [`obstore`](https://developmentseed.org/obstore/) |
31
+ | Meta | `meta` | Fills a customer list custom audience per Input | Meta's [`facebook-business`](https://github.com/facebook/facebook-python-business-sdk) SDK |
32
+ | Google DV360 | `google-dv360` | Fills a Customer Match user list per Input | Google's [`google-ads-datamanager`](https://github.com/googleads/data-manager-python) client |
33
+ | Google Ad Manager | `google-ad-manager` | Writes a batch upload file per Input to the network's GCS bucket | `obstore` |
34
+ | Adform | `adform` | Writes an identifier file per Input to Adform's S3 bucket | `obstore` |
35
+
36
+ ddc pins this package by hash in a fully locked `requirements.txt` and runs
37
+ `dq_export_connector.runner.main` in the task's Python environment. It is
38
+ published to PyPI, since the compiled graph installs it from there.
39
+
40
+ - `dq_export_connector.runner`: the entry point. Reads `/input/config.json`
41
+ and `/input/credentials.json`, sets up logging, and dispatches on the
42
+ Connector Kind and the action, then writes what the action reports under
43
+ `/internal`: an export's receipt, and either action's warnings and error, as
44
+ the task's Task Report, Application Warnings and Application Error. An action
45
+ with an error also writes it as `/internal/safe_error`, `CODE: message`,
46
+ which the container worker shows as the task's `error`, and exits with 1.
47
+ - `dq_export_connector.errors`: the error and warning codes the worker
48
+ reports, `ExportConnectorError`, which stops an action with an error code,
49
+ and `ExportConnectorWarning`. Each becomes an Application Error or Warning
50
+ with its credentials masked, its message cut to 1,000 characters and a
51
+ provider's own error to 4,000.
52
+ - `dq_export_connector.outcome`: collects a run's error, warnings and receipt
53
+ while it runs.
54
+ - `dq_export_connector.redact`: keeps every value from the sealed half, and
55
+ URL query strings, out of log lines and result messages.
56
+ - `dq_export_connector.bucket`: the bucket kind (`ValidateConnection` and
57
+ `Export`).
58
+ - `dq_export_connector.audience`: what the kinds that fill Segments share.
59
+ An Input is one value per line, which `identifiers` and `inputs` normalise,
60
+ hash where the platform takes hashes, and count when invalid. `sync` runs
61
+ an Input into its Segment through a kind's `AudienceDestination`: find the
62
+ Segment by name or create it, stage the values in batches, commit. `export`
63
+ loops over the Inputs and keeps the receipt.
64
+ - `dq_export_connector.meta` and `dq_export_connector.google_dv360`: the two
65
+ Segment kinds, each an `AudienceDestination` over its provider's library,
66
+ with a `ValidateConnection` that checks the connector's Destination Account
67
+ or lists the accounts the credentials reach.
68
+ - `dq_export_connector.files`: what the kinds that upload identifier files
69
+ share: the file's name, its rows and its upload.
70
+ - `dq_export_connector.google_ad_manager` and `dq_export_connector.adform`:
71
+ the two file kinds, which format an Input's rows and name its object.
72
+ - `dq_export_connector.oauth`, `google_auth` and `google_oauth`: Access Tokens
73
+ from an OAuth Grant, and Google credentials from either Credential Scheme.
74
+ - `dq_export_connector.models`: the types the worker reads and writes, those
75
+ of every Connector Kind directly in it and a kind's own in its submodule,
76
+ such as `models.bucket`. They are pydantic models generated in
77
+ `dq_export_connector._models` from ddc's JSON schemas, so the config the
78
+ worker reads and the receipt, warnings and errors it writes match
79
+ ddc's Rust types. Regenerate them with `scripts/codegen-models.sh` after the
80
+ types change and `decentriq_dcr_compiler` has been rebuilt; a test fails
81
+ while they are stale.
82
+
83
+ ```sh
84
+ uv run pytest # unit tests, against obstore's in-memory store and fakes of the providers' APIs
85
+ uv run pytest -m live # against real buckets and accounts, credentials from the environment
86
+ uv run mypy dq_export_connector tests
87
+ ```
88
+
89
+ A live test skips when its credentials are missing; each test file's
90
+ docstring names the variables it reads.
91
+
92
+ ## Releasing
93
+
94
+ Bump the version with `uv version <version> --no-sync`, which also updates
95
+ `uv.lock`, commit, and push a `dq-export-connector-v<version>` tag on that
96
+ commit; the `Publish dq-export-connector to PyPI` workflow tests, builds and
97
+ uploads it. Use `.devN` versions while developing; PyPI releases can't be replaced.
98
+ ddc then pins the new version, as
99
+ [ddc's export worker README](../../dcr-compiler/ddc/src/archv2/data_room/export_connector/README.md)
100
+ describes.
@@ -0,0 +1,79 @@
1
+ # dq-export-connector
2
+
3
+ Worker logic for the **Export Connector DCR**: one package for every
4
+ Connector Kind, each in its own sub-package with an extra of the same name for
5
+ its dependencies:
6
+
7
+ | Kind | Extra | What a run does | Through |
8
+ | --- | --- | --- | --- |
9
+ | Bucket | `bucket` | Uploads each Input's dataset to S3, Azure Blob or GCS | [`obstore`](https://developmentseed.org/obstore/) |
10
+ | Meta | `meta` | Fills a customer list custom audience per Input | Meta's [`facebook-business`](https://github.com/facebook/facebook-python-business-sdk) SDK |
11
+ | Google DV360 | `google-dv360` | Fills a Customer Match user list per Input | Google's [`google-ads-datamanager`](https://github.com/googleads/data-manager-python) client |
12
+ | Google Ad Manager | `google-ad-manager` | Writes a batch upload file per Input to the network's GCS bucket | `obstore` |
13
+ | Adform | `adform` | Writes an identifier file per Input to Adform's S3 bucket | `obstore` |
14
+
15
+ ddc pins this package by hash in a fully locked `requirements.txt` and runs
16
+ `dq_export_connector.runner.main` in the task's Python environment. It is
17
+ published to PyPI, since the compiled graph installs it from there.
18
+
19
+ - `dq_export_connector.runner`: the entry point. Reads `/input/config.json`
20
+ and `/input/credentials.json`, sets up logging, and dispatches on the
21
+ Connector Kind and the action, then writes what the action reports under
22
+ `/internal`: an export's receipt, and either action's warnings and error, as
23
+ the task's Task Report, Application Warnings and Application Error. An action
24
+ with an error also writes it as `/internal/safe_error`, `CODE: message`,
25
+ which the container worker shows as the task's `error`, and exits with 1.
26
+ - `dq_export_connector.errors`: the error and warning codes the worker
27
+ reports, `ExportConnectorError`, which stops an action with an error code,
28
+ and `ExportConnectorWarning`. Each becomes an Application Error or Warning
29
+ with its credentials masked, its message cut to 1,000 characters and a
30
+ provider's own error to 4,000.
31
+ - `dq_export_connector.outcome`: collects a run's error, warnings and receipt
32
+ while it runs.
33
+ - `dq_export_connector.redact`: keeps every value from the sealed half, and
34
+ URL query strings, out of log lines and result messages.
35
+ - `dq_export_connector.bucket`: the bucket kind (`ValidateConnection` and
36
+ `Export`).
37
+ - `dq_export_connector.audience`: what the kinds that fill Segments share.
38
+ An Input is one value per line, which `identifiers` and `inputs` normalise,
39
+ hash where the platform takes hashes, and count when invalid. `sync` runs
40
+ an Input into its Segment through a kind's `AudienceDestination`: find the
41
+ Segment by name or create it, stage the values in batches, commit. `export`
42
+ loops over the Inputs and keeps the receipt.
43
+ - `dq_export_connector.meta` and `dq_export_connector.google_dv360`: the two
44
+ Segment kinds, each an `AudienceDestination` over its provider's library,
45
+ with a `ValidateConnection` that checks the connector's Destination Account
46
+ or lists the accounts the credentials reach.
47
+ - `dq_export_connector.files`: what the kinds that upload identifier files
48
+ share: the file's name, its rows and its upload.
49
+ - `dq_export_connector.google_ad_manager` and `dq_export_connector.adform`:
50
+ the two file kinds, which format an Input's rows and name its object.
51
+ - `dq_export_connector.oauth`, `google_auth` and `google_oauth`: Access Tokens
52
+ from an OAuth Grant, and Google credentials from either Credential Scheme.
53
+ - `dq_export_connector.models`: the types the worker reads and writes, those
54
+ of every Connector Kind directly in it and a kind's own in its submodule,
55
+ such as `models.bucket`. They are pydantic models generated in
56
+ `dq_export_connector._models` from ddc's JSON schemas, so the config the
57
+ worker reads and the receipt, warnings and errors it writes match
58
+ ddc's Rust types. Regenerate them with `scripts/codegen-models.sh` after the
59
+ types change and `decentriq_dcr_compiler` has been rebuilt; a test fails
60
+ while they are stale.
61
+
62
+ ```sh
63
+ uv run pytest # unit tests, against obstore's in-memory store and fakes of the providers' APIs
64
+ uv run pytest -m live # against real buckets and accounts, credentials from the environment
65
+ uv run mypy dq_export_connector tests
66
+ ```
67
+
68
+ A live test skips when its credentials are missing; each test file's
69
+ docstring names the variables it reads.
70
+
71
+ ## Releasing
72
+
73
+ Bump the version with `uv version <version> --no-sync`, which also updates
74
+ `uv.lock`, commit, and push a `dq-export-connector-v<version>` tag on that
75
+ commit; the `Publish dq-export-connector to PyPI` workflow tests, builds and
76
+ uploads it. Use `.devN` versions while developing; PyPI releases can't be replaced.
77
+ ddc then pins the new version, as
78
+ [ddc's export worker README](../../dcr-compiler/ddc/src/archv2/data_room/export_connector/README.md)
79
+ describes.
@@ -8,6 +8,14 @@ from typing import Annotated, Literal
8
8
  from pydantic import BaseModel, ConfigDict, Field, RootModel
9
9
 
10
10
 
11
+ class AdformExportCredentials(BaseModel):
12
+ model_config = ConfigDict(
13
+ populate_by_name=True,
14
+ )
15
+ access_key: Annotated[str, Field(alias='accessKey')]
16
+ secret_key: Annotated[str, Field(alias='secretKey')]
17
+
18
+
11
19
  class BucketExportCredentialsS3(BaseModel):
12
20
  model_config = ConfigDict(
13
21
  populate_by_name=True,
@@ -56,6 +64,14 @@ class BucketExportCredentials(
56
64
  ]
57
65
 
58
66
 
67
+ class GoogleSealedCredentialsServiceAccount(BaseModel):
68
+ model_config = ConfigDict(
69
+ populate_by_name=True,
70
+ )
71
+ service_account_json: Annotated[str, Field(alias='serviceAccountJson')]
72
+ type: Literal['serviceAccount']
73
+
74
+
59
75
  class GrantTokenRefreshToken(BaseModel):
60
76
  model_config = ConfigDict(
61
77
  populate_by_name=True,
@@ -76,6 +92,14 @@ class GrantToken(RootModel[GrantTokenRefreshToken | GrantTokenAccessToken]):
76
92
  root: GrantTokenRefreshToken | GrantTokenAccessToken
77
93
 
78
94
 
95
+ class MetaSealedCredentialsAccessToken(BaseModel):
96
+ model_config = ConfigDict(
97
+ populate_by_name=True,
98
+ )
99
+ access_token: Annotated[str, Field(alias='accessToken')]
100
+ type: Literal['accessToken']
101
+
102
+
79
103
  class OAuthGrant(BaseModel):
80
104
  model_config = ConfigDict(
81
105
  populate_by_name=True,
@@ -93,7 +117,23 @@ class OAuthGrant(BaseModel):
93
117
  token: GrantToken
94
118
 
95
119
 
96
- class SnapExportCredentialsOauth(BaseModel):
120
+ class ExportConnectorCredentialsBucket(BaseModel):
121
+ model_config = ConfigDict(
122
+ populate_by_name=True,
123
+ )
124
+ credentials: BucketExportCredentials
125
+ type: Literal['bucket']
126
+
127
+
128
+ class ExportConnectorCredentialsAdform(BaseModel):
129
+ model_config = ConfigDict(
130
+ populate_by_name=True,
131
+ )
132
+ credentials: AdformExportCredentials
133
+ type: Literal['adform']
134
+
135
+
136
+ class GoogleSealedCredentialsOauth(BaseModel):
97
137
  model_config = ConfigDict(
98
138
  populate_by_name=True,
99
139
  )
@@ -101,33 +141,71 @@ class SnapExportCredentialsOauth(BaseModel):
101
141
  type: Literal['oauth']
102
142
 
103
143
 
104
- class SnapExportCredentials(RootModel[SnapExportCredentialsOauth]):
144
+ class GoogleSealedCredentials(
145
+ RootModel[GoogleSealedCredentialsServiceAccount | GoogleSealedCredentialsOauth]
146
+ ):
105
147
  root: Annotated[
106
- SnapExportCredentialsOauth, Field(description='What is sealed for Snap.')
148
+ GoogleSealedCredentialsServiceAccount | GoogleSealedCredentialsOauth,
149
+ Field(description='What is sealed, tagged like what was sent.'),
107
150
  ]
108
151
 
109
152
 
110
- class ExportConnectorCredentialsBucket(BaseModel):
153
+ class MetaSealedCredentialsOauth(BaseModel):
111
154
  model_config = ConfigDict(
112
155
  populate_by_name=True,
113
156
  )
114
- credentials: BucketExportCredentials
115
- type: Literal['bucket']
157
+ grant: OAuthGrant
158
+ type: Literal['oauth']
159
+
116
160
 
161
+ class MetaSealedCredentials(
162
+ RootModel[MetaSealedCredentialsAccessToken | MetaSealedCredentialsOauth]
163
+ ):
164
+ root: Annotated[
165
+ MetaSealedCredentialsAccessToken | MetaSealedCredentialsOauth,
166
+ Field(description='What is sealed, tagged like what was sent.'),
167
+ ]
117
168
 
118
- class ExportConnectorCredentialsSnap(BaseModel):
169
+
170
+ class ExportConnectorCredentialsMeta(BaseModel):
119
171
  model_config = ConfigDict(
120
172
  populate_by_name=True,
121
173
  )
122
- credentials: SnapExportCredentials
123
- type: Literal['snap']
174
+ credentials: MetaSealedCredentials
175
+ type: Literal['meta']
176
+
177
+
178
+ class ExportConnectorCredentialsGoogleDv360(BaseModel):
179
+ model_config = ConfigDict(
180
+ populate_by_name=True,
181
+ )
182
+ credentials: GoogleSealedCredentials
183
+ type: Literal['googleDv360']
184
+
185
+
186
+ class ExportConnectorCredentialsGoogleAdManager(BaseModel):
187
+ model_config = ConfigDict(
188
+ populate_by_name=True,
189
+ )
190
+ credentials: GoogleSealedCredentials
191
+ type: Literal['googleAdManager']
124
192
 
125
193
 
126
194
  class ExportConnectorCredentials(
127
- RootModel[ExportConnectorCredentialsBucket | ExportConnectorCredentialsSnap]
195
+ RootModel[
196
+ ExportConnectorCredentialsBucket
197
+ | ExportConnectorCredentialsMeta
198
+ | ExportConnectorCredentialsGoogleDv360
199
+ | ExportConnectorCredentialsGoogleAdManager
200
+ | ExportConnectorCredentialsAdform
201
+ ]
128
202
  ):
129
203
  root: Annotated[
130
- ExportConnectorCredentialsBucket | ExportConnectorCredentialsSnap,
204
+ ExportConnectorCredentialsBucket
205
+ | ExportConnectorCredentialsMeta
206
+ | ExportConnectorCredentialsGoogleDv360
207
+ | ExportConnectorCredentialsGoogleAdManager
208
+ | ExportConnectorCredentialsAdform,
131
209
  Field(
132
210
  description='Keyed by Connector Kind, in step with [`ExportConnectorKind`]. The worker\nreads it at `/input/credentials.json`.',
133
211
  title='ExportConnectorCredentials',