dq-export-connector 0.1.0.dev29__tar.gz → 0.1.0.dev30__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.
- dq_export_connector-0.1.0.dev30/.gitignore +63 -0
- dq_export_connector-0.1.0.dev30/PKG-INFO +64 -0
- dq_export_connector-0.1.0.dev30/README.md +53 -0
- dq_export_connector-0.1.0.dev29/dq_export_connector/_models/application_message.py → dq_export_connector-0.1.0.dev30/dq_export_connector/_models/application_error.py +2 -2
- dq_export_connector-0.1.0.dev29/dq_export_connector/_models/snap_validation_result.py → dq_export_connector-0.1.0.dev30/dq_export_connector/_models/application_warning.py +3 -11
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/_models/export_connector_credentials.py +2 -63
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/_models/export_receipt.py +4 -127
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/_models/export_worker_config.py +18 -130
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/bucket/export.py +1 -1
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/bucket/validate.py +2 -2
- dq_export_connector-0.1.0.dev30/dq_export_connector/errors.py +99 -0
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/log.py +13 -4
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/models/__init__.py +4 -9
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/models/bucket.py +0 -2
- dq_export_connector-0.1.0.dev30/dq_export_connector/outcome.py +44 -0
- dq_export_connector-0.1.0.dev30/dq_export_connector/redact.py +69 -0
- dq_export_connector-0.1.0.dev30/dq_export_connector/runner.py +160 -0
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/pyproject.toml +8 -11
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/scripts/codegen-models.sh +2 -2
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/tests/test_live_buckets.py +8 -6
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/tests/test_redact.py +0 -5
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/tests/test_runner.py +80 -40
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/uv.lock +238 -184
- dq_export_connector-0.1.0.dev29/.gitignore +0 -5
- dq_export_connector-0.1.0.dev29/PKG-INFO +0 -154
- dq_export_connector-0.1.0.dev29/README.md +0 -141
- dq_export_connector-0.1.0.dev29/dq_export_connector/_models/bucket_validation_result.py +0 -37
- dq_export_connector-0.1.0.dev29/dq_export_connector/_models/destination_account_listing.py +0 -48
- dq_export_connector-0.1.0.dev29/dq_export_connector/audience/classify.py +0 -81
- dq_export_connector-0.1.0.dev29/dq_export_connector/audience/http.py +0 -237
- dq_export_connector-0.1.0.dev29/dq_export_connector/audience/identifiers.py +0 -121
- dq_export_connector-0.1.0.dev29/dq_export_connector/audience/inputs.py +0 -80
- dq_export_connector-0.1.0.dev29/dq_export_connector/audience/sync.py +0 -313
- dq_export_connector-0.1.0.dev29/dq_export_connector/bucket/__init__.py +0 -0
- dq_export_connector-0.1.0.dev29/dq_export_connector/errors.py +0 -108
- dq_export_connector-0.1.0.dev29/dq_export_connector/models/snap.py +0 -50
- dq_export_connector-0.1.0.dev29/dq_export_connector/oauth.py +0 -235
- dq_export_connector-0.1.0.dev29/dq_export_connector/outcome.py +0 -77
- dq_export_connector-0.1.0.dev29/dq_export_connector/redact.py +0 -123
- dq_export_connector-0.1.0.dev29/dq_export_connector/runner.py +0 -271
- dq_export_connector-0.1.0.dev29/dq_export_connector/snap/__init__.py +0 -0
- dq_export_connector-0.1.0.dev29/dq_export_connector/snap/accounts.py +0 -18
- dq_export_connector-0.1.0.dev29/dq_export_connector/snap/client.py +0 -169
- dq_export_connector-0.1.0.dev29/dq_export_connector/snap/destination.py +0 -118
- dq_export_connector-0.1.0.dev29/dq_export_connector/snap/export.py +0 -127
- dq_export_connector-0.1.0.dev29/dq_export_connector/snap/session.py +0 -103
- dq_export_connector-0.1.0.dev29/dq_export_connector/snap/validate.py +0 -29
- dq_export_connector-0.1.0.dev29/scripts/_local.py +0 -121
- dq_export_connector-0.1.0.dev29/scripts/run_local.py +0 -54
- dq_export_connector-0.1.0.dev29/tests/__init__.py +0 -0
- dq_export_connector-0.1.0.dev29/tests/conftest.py +0 -37
- dq_export_connector-0.1.0.dev29/tests/fakes/__init__.py +0 -0
- dq_export_connector-0.1.0.dev29/tests/fakes/snap_fake.py +0 -285
- dq_export_connector-0.1.0.dev29/tests/test_http_and_oauth.py +0 -359
- dq_export_connector-0.1.0.dev29/tests/test_identifiers_and_inputs.py +0 -118
- dq_export_connector-0.1.0.dev29/tests/test_live_snap.py +0 -137
- dq_export_connector-0.1.0.dev29/tests/test_oauth.py +0 -193
- dq_export_connector-0.1.0.dev29/tests/test_outcome.py +0 -23
- dq_export_connector-0.1.0.dev29/tests/test_scripts.py +0 -22
- dq_export_connector-0.1.0.dev29/tests/test_snap_runner.py +0 -656
- dq_export_connector-0.1.0.dev29/tests/test_sync_input.py +0 -171
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/.python-version +0 -0
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/__init__.py +0 -0
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/_models/__init__.py +0 -0
- {dq_export_connector-0.1.0.dev29/dq_export_connector/audience → dq_export_connector-0.1.0.dev30/dq_export_connector/bucket}/__init__.py +0 -0
- {dq_export_connector-0.1.0.dev29/dq_export_connector → dq_export_connector-0.1.0.dev30/dq_export_connector/bucket}/datasets.py +0 -0
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/bucket/paths.py +0 -0
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/bucket/store.py +0 -0
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/dq_export_connector/bucket/upload.py +0 -0
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/tests/test_models_are_current.py +0 -0
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/tests/test_paths.py +0 -0
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/tests/test_store.py +0 -0
- {dq_export_connector-0.1.0.dev29 → dq_export_connector-0.1.0.dev30}/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,64 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: dq-export-connector
|
|
3
|
+
Version: 0.1.0.dev30
|
|
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: bucket
|
|
9
|
+
Requires-Dist: obstore<0.12,>=0.11.1; extra == 'bucket'
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# dq-export-connector
|
|
13
|
+
|
|
14
|
+
Worker logic for the **Export Connector DCR**: one package for every
|
|
15
|
+
Connector Kind, each in its own sub-package with an extra of the same name for
|
|
16
|
+
its dependencies. The **bucket** kind uploads each Input's dataset to S3, Azure
|
|
17
|
+
Blob or GCS through [`obstore`](https://developmentseed.org/obstore/).
|
|
18
|
+
|
|
19
|
+
ddc pins this package by hash in a fully locked `requirements.txt` and runs
|
|
20
|
+
`dq_export_connector.runner.main` in the task's Python environment. It is
|
|
21
|
+
published to PyPI, since the compiled graph installs it from there.
|
|
22
|
+
|
|
23
|
+
- `dq_export_connector.runner`: the entry point. Reads `/input/config.json`
|
|
24
|
+
and `/input/credentials.json`, sets up logging, and dispatches on the
|
|
25
|
+
Connector Kind and the action, then writes what the action reports under
|
|
26
|
+
`/internal`: an export's receipt, and either action's warnings and error, as
|
|
27
|
+
the task's Task Report, Application Warnings and Application Error. An action
|
|
28
|
+
with an error fails the task with it.
|
|
29
|
+
- `dq_export_connector.errors`: the error and warning codes the worker
|
|
30
|
+
reports, `ExportConnectorError`, which stops an action with an error code,
|
|
31
|
+
and `RedactedExportConnectorError`, the `decentriq_util` `SafeError` that
|
|
32
|
+
fails the task, so the container worker's `error` result ends with
|
|
33
|
+
`CODE: message`. Messages are cut to 1,000 characters, and a provider's own
|
|
34
|
+
error to 4,000, once redacted.
|
|
35
|
+
- `dq_export_connector.outcome`: collects a run's error, warnings and receipt
|
|
36
|
+
while it runs.
|
|
37
|
+
- `dq_export_connector.redact`: keeps every value from the sealed half, and
|
|
38
|
+
URL query strings, out of log lines and result messages.
|
|
39
|
+
- `dq_export_connector.bucket`: the bucket kind (`ValidateConnection` and
|
|
40
|
+
`Export`).
|
|
41
|
+
- `dq_export_connector.models`: the types the worker reads and writes, those
|
|
42
|
+
of every Connector Kind directly in it and a kind's own in its submodule,
|
|
43
|
+
such as `models.bucket`. They are pydantic models generated in
|
|
44
|
+
`dq_export_connector._models` from ddc's JSON schemas, so the config the
|
|
45
|
+
worker reads and the receipt, warnings and errors it writes match
|
|
46
|
+
ddc's Rust types. Regenerate them with `scripts/codegen-models.sh` after the
|
|
47
|
+
types change and `decentriq_dcr_compiler` has been rebuilt; a test fails
|
|
48
|
+
while they are stale.
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
uv run pytest # unit tests, against obstore's in-memory store
|
|
52
|
+
uv run pytest -m live # against real buckets, credentials from the environment
|
|
53
|
+
uv run mypy dq_export_connector tests
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Releasing
|
|
57
|
+
|
|
58
|
+
Bump the version with `uv version <version> --no-sync`, which also updates
|
|
59
|
+
`uv.lock`, commit, and push a `dq-export-connector-v<version>` tag on that
|
|
60
|
+
commit; the `Publish dq-export-connector to PyPI` workflow tests, builds and
|
|
61
|
+
uploads it. Use `.devN` versions while developing; PyPI releases can't be replaced.
|
|
62
|
+
ddc then pins the new version, as
|
|
63
|
+
[ddc's export worker README](../../dcr-compiler/ddc/src/archv2/data_room/export_connector/README.md)
|
|
64
|
+
describes.
|
|
@@ -0,0 +1,53 @@
|
|
|
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. The **bucket** kind uploads each Input's dataset to S3, Azure
|
|
6
|
+
Blob or GCS through [`obstore`](https://developmentseed.org/obstore/).
|
|
7
|
+
|
|
8
|
+
ddc pins this package by hash in a fully locked `requirements.txt` and runs
|
|
9
|
+
`dq_export_connector.runner.main` in the task's Python environment. It is
|
|
10
|
+
published to PyPI, since the compiled graph installs it from there.
|
|
11
|
+
|
|
12
|
+
- `dq_export_connector.runner`: the entry point. Reads `/input/config.json`
|
|
13
|
+
and `/input/credentials.json`, sets up logging, and dispatches on the
|
|
14
|
+
Connector Kind and the action, then writes what the action reports under
|
|
15
|
+
`/internal`: an export's receipt, and either action's warnings and error, as
|
|
16
|
+
the task's Task Report, Application Warnings and Application Error. An action
|
|
17
|
+
with an error fails the task with it.
|
|
18
|
+
- `dq_export_connector.errors`: the error and warning codes the worker
|
|
19
|
+
reports, `ExportConnectorError`, which stops an action with an error code,
|
|
20
|
+
and `RedactedExportConnectorError`, the `decentriq_util` `SafeError` that
|
|
21
|
+
fails the task, so the container worker's `error` result ends with
|
|
22
|
+
`CODE: message`. Messages are cut to 1,000 characters, and a provider's own
|
|
23
|
+
error to 4,000, once redacted.
|
|
24
|
+
- `dq_export_connector.outcome`: collects a run's error, warnings and receipt
|
|
25
|
+
while it runs.
|
|
26
|
+
- `dq_export_connector.redact`: keeps every value from the sealed half, and
|
|
27
|
+
URL query strings, out of log lines and result messages.
|
|
28
|
+
- `dq_export_connector.bucket`: the bucket kind (`ValidateConnection` and
|
|
29
|
+
`Export`).
|
|
30
|
+
- `dq_export_connector.models`: the types the worker reads and writes, those
|
|
31
|
+
of every Connector Kind directly in it and a kind's own in its submodule,
|
|
32
|
+
such as `models.bucket`. They are pydantic models generated in
|
|
33
|
+
`dq_export_connector._models` from ddc's JSON schemas, so the config the
|
|
34
|
+
worker reads and the receipt, warnings and errors it writes match
|
|
35
|
+
ddc's Rust types. Regenerate them with `scripts/codegen-models.sh` after the
|
|
36
|
+
types change and `decentriq_dcr_compiler` has been rebuilt; a test fails
|
|
37
|
+
while they are stale.
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
uv run pytest # unit tests, against obstore's in-memory store
|
|
41
|
+
uv run pytest -m live # against real buckets, credentials from the environment
|
|
42
|
+
uv run mypy dq_export_connector tests
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Releasing
|
|
46
|
+
|
|
47
|
+
Bump the version with `uv version <version> --no-sync`, which also updates
|
|
48
|
+
`uv.lock`, commit, and push a `dq-export-connector-v<version>` tag on that
|
|
49
|
+
commit; the `Publish dq-export-connector to PyPI` workflow tests, builds and
|
|
50
|
+
uploads it. Use `.devN` versions while developing; PyPI releases can't be replaced.
|
|
51
|
+
ddc then pins the new version, as
|
|
52
|
+
[ddc's export worker README](../../dcr-compiler/ddc/src/archv2/data_room/export_connector/README.md)
|
|
53
|
+
describes.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
|
-
# filename:
|
|
2
|
+
# filename: application_error.json
|
|
3
3
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ from typing import Annotated, Any
|
|
|
8
8
|
from pydantic import BaseModel, ConfigDict, Field
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class ApplicationError(BaseModel):
|
|
12
12
|
model_config = ConfigDict(
|
|
13
13
|
populate_by_name=True,
|
|
14
14
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
|
-
# filename:
|
|
2
|
+
# filename: application_warning.json
|
|
3
3
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
@@ -8,14 +8,14 @@ from typing import Annotated, Any
|
|
|
8
8
|
from pydantic import BaseModel, ConfigDict, Field
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class ApplicationWarning(BaseModel):
|
|
12
12
|
model_config = ConfigDict(
|
|
13
13
|
populate_by_name=True,
|
|
14
14
|
)
|
|
15
15
|
code: Annotated[
|
|
16
16
|
str,
|
|
17
17
|
Field(
|
|
18
|
-
description='SCREAMING_SNAKE_CASE, such as `
|
|
18
|
+
description='SCREAMING_SNAKE_CASE, such as `EMPTY_DATASET`. A string rather than an\nenum, so a worker release can add codes that readers built against an\nolder ddc still accept.'
|
|
19
19
|
),
|
|
20
20
|
]
|
|
21
21
|
details: Annotated[
|
|
@@ -27,11 +27,3 @@ class ApplicationMessage(BaseModel):
|
|
|
27
27
|
description='Safe to show to the user: no credentials and no dataset values.'
|
|
28
28
|
),
|
|
29
29
|
]
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class SnapValidationResult(BaseModel):
|
|
33
|
-
model_config = ConfigDict(
|
|
34
|
-
populate_by_name=True,
|
|
35
|
-
)
|
|
36
|
-
error: ApplicationMessage | None = None
|
|
37
|
-
warnings: list[ApplicationMessage]
|
|
@@ -56,57 +56,6 @@ class BucketExportCredentials(
|
|
|
56
56
|
]
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
class GrantTokenRefreshToken(BaseModel):
|
|
60
|
-
model_config = ConfigDict(
|
|
61
|
-
populate_by_name=True,
|
|
62
|
-
)
|
|
63
|
-
type: Literal['refreshToken']
|
|
64
|
-
value: str
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
class GrantTokenAccessToken(BaseModel):
|
|
68
|
-
model_config = ConfigDict(
|
|
69
|
-
populate_by_name=True,
|
|
70
|
-
)
|
|
71
|
-
type: Literal['accessToken']
|
|
72
|
-
value: str
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
class GrantToken(RootModel[GrantTokenRefreshToken | GrantTokenAccessToken]):
|
|
76
|
-
root: GrantTokenRefreshToken | GrantTokenAccessToken
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
class OAuthGrant(BaseModel):
|
|
80
|
-
model_config = ConfigDict(
|
|
81
|
-
populate_by_name=True,
|
|
82
|
-
)
|
|
83
|
-
client_id: Annotated[
|
|
84
|
-
str,
|
|
85
|
-
Field(
|
|
86
|
-
alias='clientId',
|
|
87
|
-
description='The OAuth App the grant was issued to; it only works with that app.',
|
|
88
|
-
),
|
|
89
|
-
]
|
|
90
|
-
obtained_at: Annotated[
|
|
91
|
-
str, Field(alias='obtainedAt', description='RFC 3339, in UTC.')
|
|
92
|
-
]
|
|
93
|
-
token: GrantToken
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
class SnapExportCredentialsOauth(BaseModel):
|
|
97
|
-
model_config = ConfigDict(
|
|
98
|
-
populate_by_name=True,
|
|
99
|
-
)
|
|
100
|
-
grant: OAuthGrant
|
|
101
|
-
type: Literal['oauth']
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
class SnapExportCredentials(RootModel[SnapExportCredentialsOauth]):
|
|
105
|
-
root: Annotated[
|
|
106
|
-
SnapExportCredentialsOauth, Field(description='What is sealed for Snap.')
|
|
107
|
-
]
|
|
108
|
-
|
|
109
|
-
|
|
110
59
|
class ExportConnectorCredentialsBucket(BaseModel):
|
|
111
60
|
model_config = ConfigDict(
|
|
112
61
|
populate_by_name=True,
|
|
@@ -115,19 +64,9 @@ class ExportConnectorCredentialsBucket(BaseModel):
|
|
|
115
64
|
type: Literal['bucket']
|
|
116
65
|
|
|
117
66
|
|
|
118
|
-
class
|
|
119
|
-
model_config = ConfigDict(
|
|
120
|
-
populate_by_name=True,
|
|
121
|
-
)
|
|
122
|
-
credentials: SnapExportCredentials
|
|
123
|
-
type: Literal['snap']
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
class ExportConnectorCredentials(
|
|
127
|
-
RootModel[ExportConnectorCredentialsBucket | ExportConnectorCredentialsSnap]
|
|
128
|
-
):
|
|
67
|
+
class ExportConnectorCredentials(RootModel[ExportConnectorCredentialsBucket]):
|
|
129
68
|
root: Annotated[
|
|
130
|
-
ExportConnectorCredentialsBucket
|
|
69
|
+
ExportConnectorCredentialsBucket,
|
|
131
70
|
Field(
|
|
132
71
|
description='Keyed by Connector Kind, in step with [`ExportConnectorKind`]. The worker\nreads it at `/input/credentials.json`.',
|
|
133
72
|
title='ExportConnectorCredentials',
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
|
-
from enum import Enum
|
|
7
6
|
from typing import Annotated, Literal
|
|
8
7
|
|
|
9
8
|
from pydantic import BaseModel, ConfigDict, Field, RootModel
|
|
10
|
-
from typing_extensions import TypeAliasType
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
class BucketConnectionS3(BaseModel):
|
|
@@ -64,70 +62,6 @@ class ExportTotals(BaseModel):
|
|
|
64
62
|
] = None
|
|
65
63
|
|
|
66
64
|
|
|
67
|
-
class MergeMode(Enum):
|
|
68
|
-
add = 'ADD'
|
|
69
|
-
replace = 'REPLACE'
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
InvalidReasonsAdditionalProperty = TypeAliasType(
|
|
73
|
-
"InvalidReasonsAdditionalProperty", Annotated[int, Field(ge=0)]
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class SegmentCounts(BaseModel):
|
|
78
|
-
model_config = ConfigDict(
|
|
79
|
-
populate_by_name=True,
|
|
80
|
-
)
|
|
81
|
-
invalid: Annotated[int, Field(ge=0)]
|
|
82
|
-
invalid_reasons: Annotated[
|
|
83
|
-
dict[str, InvalidReasonsAdditionalProperty],
|
|
84
|
-
Field(
|
|
85
|
-
alias='invalidReasons',
|
|
86
|
-
description='Invalid rows per reason, such as `EMAIL_NO_AT_SIGN`.',
|
|
87
|
-
),
|
|
88
|
-
]
|
|
89
|
-
rejected_by_platform: Annotated[
|
|
90
|
-
int | None,
|
|
91
|
-
Field(
|
|
92
|
-
alias='rejectedByPlatform',
|
|
93
|
-
description="`None` where the platform doesn't say.",
|
|
94
|
-
ge=0,
|
|
95
|
-
),
|
|
96
|
-
] = None
|
|
97
|
-
rows: Annotated[
|
|
98
|
-
int, Field(description='Non-empty lines read from the Input.', ge=0)
|
|
99
|
-
]
|
|
100
|
-
submitted: Annotated[
|
|
101
|
-
int,
|
|
102
|
-
Field(
|
|
103
|
-
description='Values sent to the platform, also from an Input that failed partway.',
|
|
104
|
-
ge=0,
|
|
105
|
-
),
|
|
106
|
-
]
|
|
107
|
-
valid: Annotated[int, Field(ge=0)]
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
class SegmentTotals(BaseModel):
|
|
111
|
-
model_config = ConfigDict(
|
|
112
|
-
populate_by_name=True,
|
|
113
|
-
)
|
|
114
|
-
invalid: Annotated[int, Field(ge=0)]
|
|
115
|
-
rows: Annotated[int, Field(ge=0)]
|
|
116
|
-
submitted: Annotated[int, Field(ge=0)]
|
|
117
|
-
valid: Annotated[int, Field(ge=0)]
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
class SnapSegmentStatus(BaseModel):
|
|
121
|
-
model_config = ConfigDict(
|
|
122
|
-
populate_by_name=True,
|
|
123
|
-
)
|
|
124
|
-
approximate_number_users: Annotated[
|
|
125
|
-
int | None, Field(alias='approximateNumberUsers', ge=0)
|
|
126
|
-
] = None
|
|
127
|
-
targetable_status: Annotated[str | None, Field(alias='targetableStatus')] = None
|
|
128
|
-
upload_status: Annotated[str | None, Field(alias='uploadStatus')] = None
|
|
129
|
-
|
|
130
|
-
|
|
131
65
|
class BucketInputReceipt(BaseModel):
|
|
132
66
|
model_config = ConfigDict(
|
|
133
67
|
populate_by_name=True,
|
|
@@ -161,29 +95,8 @@ class ExportReceiptV0Bucket(BaseModel):
|
|
|
161
95
|
type: Literal['BUCKET']
|
|
162
96
|
|
|
163
97
|
|
|
164
|
-
class
|
|
165
|
-
|
|
166
|
-
populate_by_name=True,
|
|
167
|
-
)
|
|
168
|
-
counts: SegmentCounts
|
|
169
|
-
created: Annotated[bool, Field(description='Whether this run created the Segment.')]
|
|
170
|
-
leaf_id: Annotated[str, Field(alias='leafId')]
|
|
171
|
-
merge_mode: Annotated[MergeMode, Field(alias='mergeMode')]
|
|
172
|
-
segment_id: Annotated[
|
|
173
|
-
str | None,
|
|
174
|
-
Field(
|
|
175
|
-
alias='segmentId',
|
|
176
|
-
description='`None` until the run found or created the Segment.',
|
|
177
|
-
),
|
|
178
|
-
] = None
|
|
179
|
-
segment_name: Annotated[str, Field(alias='segmentName')]
|
|
180
|
-
segment_status: Annotated[
|
|
181
|
-
SnapSegmentStatus | None,
|
|
182
|
-
Field(
|
|
183
|
-
alias='segmentStatus',
|
|
184
|
-
description='The Segment as Snap reported it after the upload.',
|
|
185
|
-
),
|
|
186
|
-
] = None
|
|
98
|
+
class ExportReceiptV0(RootModel[ExportReceiptV0Bucket]):
|
|
99
|
+
root: ExportReceiptV0Bucket
|
|
187
100
|
|
|
188
101
|
|
|
189
102
|
class VersionedExportReceiptV0Bucket(BaseModel):
|
|
@@ -206,22 +119,9 @@ class VersionedExportReceiptV0Bucket(BaseModel):
|
|
|
206
119
|
type: Literal['BUCKET']
|
|
207
120
|
|
|
208
121
|
|
|
209
|
-
class
|
|
210
|
-
model_config = ConfigDict(
|
|
211
|
-
populate_by_name=True,
|
|
212
|
-
)
|
|
213
|
-
version: Literal['V0']
|
|
214
|
-
ad_account_id: Annotated[str, Field(alias='adAccountId')]
|
|
215
|
-
inputs: list[SnapInputReceipt]
|
|
216
|
-
totals: SegmentTotals
|
|
217
|
-
type: Literal['SNAP']
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
class ExportReceipt(
|
|
221
|
-
RootModel[VersionedExportReceiptV0Bucket | VersionedExportReceiptV0Snap]
|
|
222
|
-
):
|
|
122
|
+
class ExportReceipt(RootModel[VersionedExportReceiptV0Bucket]):
|
|
223
123
|
root: Annotated[
|
|
224
|
-
VersionedExportReceiptV0Bucket
|
|
124
|
+
VersionedExportReceiptV0Bucket,
|
|
225
125
|
Field(
|
|
226
126
|
description='What an Export Connector Run sent and where. api-platform reads it in\nplaintext, so it holds only metadata, never dataset values. A released\nversion never changes: a change is a new version, and readers keep reading\nevery version ever written.',
|
|
227
127
|
title='ExportReceipt',
|
|
@@ -245,26 +145,3 @@ class BucketExportReceiptV0(BaseModel):
|
|
|
245
145
|
] = None
|
|
246
146
|
inputs: list[BucketInputReceipt]
|
|
247
147
|
totals: ExportTotals
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
class ExportReceiptV0Snap(BaseModel):
|
|
251
|
-
model_config = ConfigDict(
|
|
252
|
-
populate_by_name=True,
|
|
253
|
-
)
|
|
254
|
-
ad_account_id: Annotated[str, Field(alias='adAccountId')]
|
|
255
|
-
inputs: list[SnapInputReceipt]
|
|
256
|
-
totals: SegmentTotals
|
|
257
|
-
type: Literal['SNAP']
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
class ExportReceiptV0(RootModel[ExportReceiptV0Bucket | ExportReceiptV0Snap]):
|
|
261
|
-
root: ExportReceiptV0Bucket | ExportReceiptV0Snap
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
class SnapExportReceiptV0(BaseModel):
|
|
265
|
-
model_config = ConfigDict(
|
|
266
|
-
populate_by_name=True,
|
|
267
|
-
)
|
|
268
|
-
ad_account_id: Annotated[str, Field(alias='adAccountId')]
|
|
269
|
-
inputs: list[SnapInputReceipt]
|
|
270
|
-
totals: SegmentTotals
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
|
-
from enum import Enum
|
|
7
6
|
from typing import Annotated, Literal
|
|
8
7
|
|
|
9
8
|
from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel
|
|
@@ -57,11 +56,6 @@ class BucketInput(BaseModel):
|
|
|
57
56
|
leaf_id: Annotated[str, Field(alias='leafId')]
|
|
58
57
|
|
|
59
58
|
|
|
60
|
-
class ClientAuth(Enum):
|
|
61
|
-
form_body = 'formBody'
|
|
62
|
-
http_basic = 'httpBasic'
|
|
63
|
-
|
|
64
|
-
|
|
65
59
|
class ExportConnectorKindBucket(BaseModel):
|
|
66
60
|
model_config = ConfigDict(
|
|
67
61
|
populate_by_name=True,
|
|
@@ -78,47 +72,19 @@ class ExportConnectorKindBucket(BaseModel):
|
|
|
78
72
|
type: Literal['bucket']
|
|
79
73
|
|
|
80
74
|
|
|
81
|
-
class
|
|
82
|
-
|
|
83
|
-
populate_by_name=True,
|
|
84
|
-
)
|
|
85
|
-
type: Literal['bucket']
|
|
75
|
+
class ExportConnectorKind(RootModel[ExportConnectorKindBucket]):
|
|
76
|
+
root: ExportConnectorKindBucket
|
|
86
77
|
|
|
87
78
|
|
|
88
|
-
class
|
|
79
|
+
class ExportParamsBucket(BaseModel):
|
|
89
80
|
model_config = ConfigDict(
|
|
90
81
|
populate_by_name=True,
|
|
91
82
|
)
|
|
92
|
-
type: Literal['
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
class ExportParams(RootModel[ExportParamsBucket | ExportParamsSnap]):
|
|
96
|
-
root: ExportParamsBucket | ExportParamsSnap
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
class IdentifierType(Enum):
|
|
100
|
-
email = 'EMAIL'
|
|
101
|
-
email_sha256 = 'EMAIL_SHA256'
|
|
102
|
-
phone = 'PHONE'
|
|
103
|
-
phone_sha256 = 'PHONE_SHA256'
|
|
104
|
-
idfa = 'IDFA'
|
|
105
|
-
idfa_sha256 = 'IDFA_SHA256'
|
|
106
|
-
gaid = 'GAID'
|
|
107
|
-
gaid_sha256 = 'GAID_SHA256'
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
class MergeMode(Enum):
|
|
111
|
-
add = 'ADD'
|
|
112
|
-
replace = 'REPLACE'
|
|
83
|
+
type: Literal['bucket']
|
|
113
84
|
|
|
114
85
|
|
|
115
|
-
class
|
|
116
|
-
|
|
117
|
-
populate_by_name=True,
|
|
118
|
-
)
|
|
119
|
-
client_auth: Annotated[ClientAuth, Field(alias='clientAuth')]
|
|
120
|
-
platform_secret: Annotated[str, Field(alias='platformSecret')]
|
|
121
|
-
token_url: Annotated[str, Field(alias='tokenUrl')]
|
|
86
|
+
class ExportParams(RootModel[ExportParamsBucket]):
|
|
87
|
+
root: ExportParamsBucket
|
|
122
88
|
|
|
123
89
|
|
|
124
90
|
class ProvisionedPolicy(BaseModel):
|
|
@@ -139,30 +105,6 @@ class ProvisionedPolicy(BaseModel):
|
|
|
139
105
|
]
|
|
140
106
|
|
|
141
107
|
|
|
142
|
-
class SnapInput(BaseModel):
|
|
143
|
-
model_config = ConfigDict(
|
|
144
|
-
populate_by_name=True,
|
|
145
|
-
)
|
|
146
|
-
identifier_type: Annotated[IdentifierType, Field(alias='identifierType')]
|
|
147
|
-
leaf_id: Annotated[str, Field(alias='leafId')]
|
|
148
|
-
merge_mode: Annotated[MergeMode, Field(alias='mergeMode')]
|
|
149
|
-
retention_days: Annotated[
|
|
150
|
-
int | None,
|
|
151
|
-
Field(
|
|
152
|
-
alias='retentionDays',
|
|
153
|
-
description='Applied when the Segment is created.',
|
|
154
|
-
ge=0,
|
|
155
|
-
),
|
|
156
|
-
] = None
|
|
157
|
-
segment_name: Annotated[
|
|
158
|
-
str,
|
|
159
|
-
Field(
|
|
160
|
-
alias='segmentName',
|
|
161
|
-
description='The Segment is found by this name in the ad account, or created.',
|
|
162
|
-
),
|
|
163
|
-
]
|
|
164
|
-
|
|
165
|
-
|
|
166
108
|
class ValidateConnectionParamsBucket(BaseModel):
|
|
167
109
|
model_config = ConfigDict(
|
|
168
110
|
populate_by_name=True,
|
|
@@ -170,9 +112,8 @@ class ValidateConnectionParamsBucket(BaseModel):
|
|
|
170
112
|
type: Literal['bucket']
|
|
171
113
|
|
|
172
114
|
|
|
173
|
-
class
|
|
174
|
-
|
|
175
|
-
list = 'list'
|
|
115
|
+
class ValidateConnectionParams(RootModel[ValidateConnectionParamsBucket]):
|
|
116
|
+
root: ValidateConnectionParamsBucket
|
|
176
117
|
|
|
177
118
|
|
|
178
119
|
class BucketExportConfig(BaseModel):
|
|
@@ -190,85 +131,36 @@ class BucketExportConfig(BaseModel):
|
|
|
190
131
|
inputs: list[BucketInput]
|
|
191
132
|
|
|
192
133
|
|
|
193
|
-
class
|
|
134
|
+
class ValidateConnection(BaseModel):
|
|
194
135
|
model_config = ConfigDict(
|
|
195
136
|
populate_by_name=True,
|
|
196
137
|
)
|
|
197
|
-
params:
|
|
138
|
+
params: ValidateConnectionParams
|
|
198
139
|
|
|
199
140
|
|
|
200
|
-
class
|
|
141
|
+
class ExportConnectorDcrComputeActionValidateConnection(BaseModel):
|
|
201
142
|
model_config = ConfigDict(
|
|
202
143
|
extra='forbid',
|
|
203
144
|
populate_by_name=True,
|
|
204
145
|
)
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
class ExportConnectorKindSnap(BaseModel):
|
|
209
|
-
model_config = ConfigDict(
|
|
210
|
-
populate_by_name=True,
|
|
211
|
-
)
|
|
212
|
-
ad_account_id: Annotated[
|
|
213
|
-
str | None,
|
|
214
|
-
Field(
|
|
215
|
-
alias='adAccountId',
|
|
216
|
-
description='A canonical, lowercase UUID. `None` until the owner picks one from the\nad accounts the grant reaches.',
|
|
217
|
-
),
|
|
218
|
-
] = None
|
|
219
|
-
inputs: list[SnapInput]
|
|
220
|
-
type: Literal['snap']
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
class ExportConnectorKind(
|
|
224
|
-
RootModel[ExportConnectorKindBucket | ExportConnectorKindSnap]
|
|
225
|
-
):
|
|
226
|
-
root: ExportConnectorKindBucket | ExportConnectorKindSnap
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
class SnapExportConfig(BaseModel):
|
|
230
|
-
model_config = ConfigDict(
|
|
231
|
-
populate_by_name=True,
|
|
232
|
-
)
|
|
233
|
-
ad_account_id: Annotated[
|
|
234
|
-
str | None,
|
|
235
|
-
Field(
|
|
236
|
-
alias='adAccountId',
|
|
237
|
-
description='A canonical, lowercase UUID. `None` until the owner picks one from the\nad accounts the grant reaches.',
|
|
238
|
-
),
|
|
239
|
-
] = None
|
|
240
|
-
inputs: list[SnapInput]
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
class ValidateConnectionParamsSnap(BaseModel):
|
|
244
|
-
model_config = ConfigDict(
|
|
245
|
-
populate_by_name=True,
|
|
246
|
-
)
|
|
247
|
-
mode: ValidationMode
|
|
248
|
-
type: Literal['snap']
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
class ValidateConnectionParams(
|
|
252
|
-
RootModel[ValidateConnectionParamsBucket | ValidateConnectionParamsSnap]
|
|
253
|
-
):
|
|
254
|
-
root: ValidateConnectionParamsBucket | ValidateConnectionParamsSnap
|
|
146
|
+
validate_connection: Annotated[
|
|
147
|
+
ValidateConnection, Field(alias='validateConnection')
|
|
148
|
+
]
|
|
255
149
|
|
|
256
150
|
|
|
257
|
-
class
|
|
151
|
+
class Export(BaseModel):
|
|
258
152
|
model_config = ConfigDict(
|
|
259
153
|
populate_by_name=True,
|
|
260
154
|
)
|
|
261
|
-
params:
|
|
155
|
+
params: ExportParams
|
|
262
156
|
|
|
263
157
|
|
|
264
|
-
class
|
|
158
|
+
class ExportConnectorDcrComputeActionExport(BaseModel):
|
|
265
159
|
model_config = ConfigDict(
|
|
266
160
|
extra='forbid',
|
|
267
161
|
populate_by_name=True,
|
|
268
162
|
)
|
|
269
|
-
|
|
270
|
-
ValidateConnection, Field(alias='validateConnection')
|
|
271
|
-
]
|
|
163
|
+
export: Export
|
|
272
164
|
|
|
273
165
|
|
|
274
166
|
class ExportConnectorDcrComputeAction(
|
|
@@ -296,8 +188,4 @@ class ExportWorkerConfig(BaseModel):
|
|
|
296
188
|
AwareDatetime | None,
|
|
297
189
|
Field(alias='credentialsExpireAt', description='From the Credentials Info.'),
|
|
298
190
|
] = None
|
|
299
|
-
oauth: Annotated[
|
|
300
|
-
OAuthWorkerConfig | None,
|
|
301
|
-
Field(description='For a kind whose credentials are an OAuth Grant.'),
|
|
302
|
-
] = None
|
|
303
191
|
policies: list[ProvisionedPolicy]
|