dq-export-connector 0.1.0.dev25__tar.gz → 0.1.0.dev26__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 (35) hide show
  1. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/PKG-INFO +3 -3
  2. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/README.md +2 -2
  3. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/bucket/export.py +3 -3
  4. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/bucket/validate.py +2 -2
  5. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/errors.py +6 -4
  6. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/outcome.py +4 -4
  7. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/pyproject.toml +1 -1
  8. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/uv.lock +1 -1
  9. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/.gitignore +0 -0
  10. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/.python-version +0 -0
  11. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/__init__.py +0 -0
  12. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/_models/__init__.py +0 -0
  13. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/_models/application_message.py +0 -0
  14. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/_models/bucket_validation_result.py +0 -0
  15. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/_models/export_connector_credentials.py +0 -0
  16. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/_models/export_receipt.py +0 -0
  17. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/_models/export_worker_config.py +0 -0
  18. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/bucket/__init__.py +0 -0
  19. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/bucket/datasets.py +0 -0
  20. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/bucket/paths.py +0 -0
  21. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/bucket/store.py +0 -0
  22. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/bucket/upload.py +0 -0
  23. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/log.py +0 -0
  24. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/models/__init__.py +0 -0
  25. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/models/bucket.py +0 -0
  26. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/redact.py +0 -0
  27. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/dq_export_connector/runner.py +0 -0
  28. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/scripts/codegen-models.sh +0 -0
  29. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/tests/test_live_buckets.py +0 -0
  30. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/tests/test_models_are_current.py +0 -0
  31. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/tests/test_paths.py +0 -0
  32. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/tests/test_redact.py +0 -0
  33. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/tests/test_runner.py +0 -0
  34. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/tests/test_store.py +0 -0
  35. {dq_export_connector-0.1.0.dev25 → dq_export_connector-0.1.0.dev26}/tests/test_upload.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: dq-export-connector
3
- Version: 0.1.0.dev25
3
+ Version: 0.1.0.dev26
4
4
  Summary: Worker logic for the Export Connector DCR.
5
5
  Author: Decentriq
6
6
  Requires-Python: >=3.12
@@ -26,8 +26,8 @@ published to PyPI, since the compiled graph installs it from there.
26
26
  connection test's result into `/output`, and an export's receipt and either
27
27
  action's warnings and error under `/internal`, as the task's Task Report,
28
28
  Application Warnings and Application Error. A run with an error fails.
29
- - `dq_export_connector.errors`: the codes the worker reports, and
30
- `ExportConnectorError`, which stops a run with one.
29
+ - `dq_export_connector.errors`: the error and warning codes the worker
30
+ reports, and `ExportConnectorError`, which stops a run with an error code.
31
31
  - `dq_export_connector.outcome`: collects a run's error, warnings and receipt
32
32
  while it runs, and cuts each message to 1,000 characters, and a provider's
33
33
  own error to 4,000, once redacted.
@@ -15,8 +15,8 @@ published to PyPI, since the compiled graph installs it from there.
15
15
  connection test's result into `/output`, and an export's receipt and either
16
16
  action's warnings and error under `/internal`, as the task's Task Report,
17
17
  Application Warnings and Application Error. A run with an error fails.
18
- - `dq_export_connector.errors`: the codes the worker reports, and
19
- `ExportConnectorError`, which stops a run with one.
18
+ - `dq_export_connector.errors`: the error and warning codes the worker
19
+ reports, and `ExportConnectorError`, which stops a run with an error code.
20
20
  - `dq_export_connector.outcome`: collects a run's error, warnings and receipt
21
21
  while it runs, and cuts each message to 1,000 characters, and a provider's
22
22
  own error to 4,000, once redacted.
@@ -16,7 +16,7 @@ from dq_export_connector.bucket.datasets import DatasetFile, open_dataset
16
16
  from dq_export_connector.bucket.paths import InvalidPathError, check_dataset_path, check_key, fill_date_tokens, join_key
17
17
  from dq_export_connector.bucket.store import StorageError, classify_error, describe_destination, failure_sentence
18
18
  from dq_export_connector.bucket.upload import plan_upload, upload
19
- from dq_export_connector.errors import ErrorCode, ExportConnectorError
19
+ from dq_export_connector.errors import ErrorCode, ExportConnectorError, WarningCode
20
20
  from dq_export_connector.log import logger
21
21
  from dq_export_connector.models import ExportReceiptV0, ExportTotals, ProvisionedPolicy
22
22
  from dq_export_connector.models.bucket import (
@@ -109,7 +109,7 @@ def _check_input(
109
109
  ) from error
110
110
  if not layout.files:
111
111
  outcome.warn(
112
- ErrorCode.EMPTY_DATASET, f"The dataset for '{destination}/' has no files, so nothing was written there"
112
+ WarningCode.EMPTY_DATASET, f"The dataset for '{destination}/' has no files, so nothing was written there"
113
113
  )
114
114
 
115
115
 
@@ -143,7 +143,7 @@ def _export_input(
143
143
  except StorageError as error:
144
144
  if plan.multipart:
145
145
  outcome.warn(
146
- ErrorCode.BUCKET_PARTS_MAY_REMAIN,
146
+ WarningCode.BUCKET_PARTS_MAY_REMAIN,
147
147
  f"Parts of the unfinished upload of '{key}' may remain in the {describe_destination(connection)}. They"
148
148
  " don't show up as files, and a lifecycle rule for incomplete uploads removes them",
149
149
  )
@@ -18,7 +18,7 @@ from dq_export_connector.bucket.store import (
18
18
  failure_sentence,
19
19
  storage_request,
20
20
  )
21
- from dq_export_connector.errors import ErrorCode, ExportConnectorError
21
+ from dq_export_connector.errors import ErrorCode, ExportConnectorError, WarningCode
22
22
  from dq_export_connector.log import logger
23
23
  from dq_export_connector.models.bucket import BucketConnection, BucketExportCredentials
24
24
  from dq_export_connector.outcome import RunOutcome
@@ -58,7 +58,7 @@ def validate_connection(
58
58
  except StorageError as error:
59
59
  logger.warning("Deleting the probe %r failed: %s", key, error)
60
60
  outcome.warn(
61
- ErrorCode.BUCKET_PROBE_NOT_DELETED,
61
+ WarningCode.BUCKET_PROBE_NOT_DELETED,
62
62
  f"The connection test wrote its test object '{key}' but couldn't delete it; it's safe to delete",
63
63
  str(error),
64
64
  )
@@ -1,6 +1,6 @@
1
- """The codes the worker reports, and the error that stops a run with one. A
2
- code shared by every Connector Kind has no prefix; one only a kind can report
3
- carries the kind's prefix, such as `BUCKET_`."""
1
+ """The error and warning codes the worker reports, and the error that stops a
2
+ run with an error code. A code shared by every Connector Kind has no prefix;
3
+ one only a kind can report carries the kind's prefix, such as `BUCKET_`."""
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -19,7 +19,9 @@ class ErrorCode(str, Enum):
19
19
  READ_FAILED = "READ_FAILED"
20
20
  INTERNAL_ERROR = "INTERNAL_ERROR"
21
21
  BUCKET_INVALID_PATH = "BUCKET_INVALID_PATH"
22
- # Warnings
22
+
23
+
24
+ class WarningCode(str, Enum):
23
25
  EMPTY_DATASET = "EMPTY_DATASET"
24
26
  BUCKET_PROBE_NOT_DELETED = "BUCKET_PROBE_NOT_DELETED"
25
27
  BUCKET_PARTS_MAY_REMAIN = "BUCKET_PARTS_MAY_REMAIN"
@@ -5,7 +5,7 @@ from __future__ import annotations
5
5
 
6
6
  from typing import Any
7
7
 
8
- from dq_export_connector.errors import MAX_MESSAGE_LENGTH, MAX_PROVIDER_ERROR_LENGTH, ErrorCode, truncate
8
+ from dq_export_connector.errors import MAX_MESSAGE_LENGTH, MAX_PROVIDER_ERROR_LENGTH, ErrorCode, WarningCode, truncate
9
9
  from dq_export_connector.models import ApplicationMessage, ExportReceipt, ExportReceiptV0
10
10
  from dq_export_connector.models.bucket import BucketValidationResult
11
11
  from dq_export_connector.redact import Redactor
@@ -14,10 +14,10 @@ from dq_export_connector.redact import Redactor
14
14
  class RunOutcome:
15
15
  def __init__(self) -> None:
16
16
  self.error: tuple[ErrorCode, str, str | None] | None = None
17
- self.warnings: list[tuple[ErrorCode, str, str | None]] = []
17
+ self.warnings: list[tuple[WarningCode, str, str | None]] = []
18
18
  self.receipt: ExportReceiptV0 | None = None
19
19
 
20
- def warn(self, code: ErrorCode, message: str, provider_error: str | None = None) -> None:
20
+ def warn(self, code: WarningCode, message: str, provider_error: str | None = None) -> None:
21
21
  self.warnings.append((code, message, provider_error))
22
22
 
23
23
  def fail(self, code: ErrorCode, message: str, provider_error: str | None = None) -> None:
@@ -43,7 +43,7 @@ class RunOutcome:
43
43
  )
44
44
 
45
45
 
46
- def _application_message(code: ErrorCode, text: str, provider_error: str | None, redactor: Redactor) -> dict[str, Any]:
46
+ def _application_message(code: ErrorCode | WarningCode, text: str, provider_error: str | None, redactor: Redactor) -> dict[str, Any]:
47
47
  # Cut once redacted, so a cut can't leave part of a secret unmasked.
48
48
  message: dict[str, Any] = {"code": code.value, "message": truncate(redactor.redact(text), MAX_MESSAGE_LENGTH)}
49
49
  if provider_error is not None:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dq-export-connector"
3
- version = "0.1.0.dev25"
3
+ version = "0.1.0.dev26"
4
4
  description = "Worker logic for the Export Connector DCR."
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Decentriq" }]
@@ -90,7 +90,7 @@ wheels = [
90
90
 
91
91
  [[package]]
92
92
  name = "dq-export-connector"
93
- version = "0.1.0.dev25"
93
+ version = "0.1.0.dev26"
94
94
  source = { editable = "." }
95
95
  dependencies = [
96
96
  { name = "pydantic" },