cognite-extractor-utils 7.5.9__tar.gz → 7.5.11__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.
Potentially problematic release.
This version of cognite-extractor-utils might be problematic. Click here for more details.
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/PKG-INFO +2 -2
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/__init__.py +1 -1
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/configuration/models.py +31 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader/files.py +14 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/pyproject.toml +2 -2
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/.gitignore +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/LICENSE +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/README.md +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/_inner_util.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/base.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/configtools/__init__.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/configtools/_util.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/configtools/elements.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/configtools/loaders.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/configtools/validators.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/exceptions.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/metrics.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/py.typed +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/statestore/__init__.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/statestore/_base.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/statestore/hashing.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/statestore/watermark.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/threading.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/__init__.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/configuration/__init__.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/configuration/exceptions.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/configuration/loaders.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/core/__init__.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/core/_dto.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/core/_messaging.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/core/base.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/core/errors.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/core/logger.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/core/restart_policy.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/core/runtime.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/core/tasks.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/scheduling/__init__.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/scheduling/_scheduler.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/unstable/scheduling/_schedules.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader/__init__.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader/_base.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader/_metrics.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader/assets.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader/data_modeling.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader/events.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader/raw.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader/time_series.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader/upload_failure_handler.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader_extractor.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/uploader_types.py +0 -0
- {cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognite-extractor-utils
|
|
3
|
-
Version: 7.5.
|
|
3
|
+
Version: 7.5.11
|
|
4
4
|
Summary: Utilities for easier development of extractors for CDF
|
|
5
5
|
Project-URL: repository, https://github.com/cognitedata/python-extractor-utils
|
|
6
6
|
Author-email: Mathias Lohne <mathias.lohne@cognite.com>
|
|
@@ -14,7 +14,7 @@ Requires-Dist: azure-identity>=1.14.0
|
|
|
14
14
|
Requires-Dist: azure-keyvault-secrets>=4.7.0
|
|
15
15
|
Requires-Dist: cognite-sdk>=7.59.0
|
|
16
16
|
Requires-Dist: croniter>=6.0.0
|
|
17
|
-
Requires-Dist: dacite
|
|
17
|
+
Requires-Dist: dacite<1.9.0,>=1.6.0
|
|
18
18
|
Requires-Dist: decorator>=5.1.1
|
|
19
19
|
Requires-Dist: httpx<1,>=0.27.0
|
|
20
20
|
Requires-Dist: jsonlines>=4.0.0
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
import re
|
|
2
3
|
from datetime import timedelta
|
|
3
4
|
from enum import Enum
|
|
@@ -215,6 +216,36 @@ class ConnectionConfig(ConfigModel):
|
|
|
215
216
|
|
|
216
217
|
return CogniteClient(client_config)
|
|
217
218
|
|
|
219
|
+
@classmethod
|
|
220
|
+
def from_environment(cls) -> "ConnectionConfig":
|
|
221
|
+
auth: AuthenticationConfig
|
|
222
|
+
if "COGNITE_CLIENT_SECRET" in os.environ:
|
|
223
|
+
auth = _ClientCredentialsConfig(
|
|
224
|
+
type="client-credentials",
|
|
225
|
+
client_id=os.environ["COGNITE_CLIENT_ID"],
|
|
226
|
+
client_secret=os.environ["COGNITE_CLIENT_SECRET"],
|
|
227
|
+
token_url=os.environ["COGNITE_TOKEN_URL"],
|
|
228
|
+
scopes=os.environ["COGNITE_TOKEN_SCOPES"].split(","),
|
|
229
|
+
)
|
|
230
|
+
elif "COGNITE_CLIENT_CERTIFICATE_PATH" in os.environ:
|
|
231
|
+
auth = _ClientCertificateConfig(
|
|
232
|
+
type="client-certificate",
|
|
233
|
+
client_id=os.environ["COGNITE_CLIENT_ID"],
|
|
234
|
+
path=Path(os.environ["COGNITE_CLIENT_CERTIFICATE_PATH"]),
|
|
235
|
+
password=os.environ.get("COGNITE_CLIENT_CERTIFICATE_PATH"),
|
|
236
|
+
authority_url=os.environ["COGNITE_AUTHORITY_URL"],
|
|
237
|
+
scopes=os.environ["COGNITE_TOKEN_SCOPES"].split(","),
|
|
238
|
+
)
|
|
239
|
+
else:
|
|
240
|
+
raise KeyError("Missing auth, either COGNITE_CLIENT_SECRET or COGNITE_CLIENT_CERTIFICATE_PATH must be set")
|
|
241
|
+
|
|
242
|
+
return ConnectionConfig(
|
|
243
|
+
project=os.environ["COGNITE_PROJECT"],
|
|
244
|
+
base_url=os.environ["COGNITE_BASE_URL"],
|
|
245
|
+
integration=os.environ["COGNITE_INTEGRATION"],
|
|
246
|
+
authentication=auth,
|
|
247
|
+
)
|
|
248
|
+
|
|
218
249
|
|
|
219
250
|
class CronConfig(ConfigModel):
|
|
220
251
|
type: Literal["cron"]
|
|
@@ -25,6 +25,7 @@ from typing import (
|
|
|
25
25
|
)
|
|
26
26
|
from urllib.parse import ParseResult, urlparse
|
|
27
27
|
|
|
28
|
+
from h11._util import LocalProtocolError
|
|
28
29
|
from httpx import URL, Client, Headers, Request, StreamConsumed, SyncByteStream
|
|
29
30
|
from requests.utils import super_len
|
|
30
31
|
|
|
@@ -481,6 +482,19 @@ class IOFileUploadQueue(AbstractUploadQueue):
|
|
|
481
482
|
try:
|
|
482
483
|
upload_file(read_file, file_meta)
|
|
483
484
|
|
|
485
|
+
except LocalProtocolError as e:
|
|
486
|
+
error_message = str(e)
|
|
487
|
+
if (
|
|
488
|
+
"Too much data for declared Content" in error_message
|
|
489
|
+
or "Too little data for declared Content-Length" in error_message
|
|
490
|
+
):
|
|
491
|
+
self.logger.error(
|
|
492
|
+
f"Content Length Mismatch while uploading file: {file_meta} error message: {error_message}"
|
|
493
|
+
)
|
|
494
|
+
|
|
495
|
+
self.add_entry_failure_logger(file_name=str(file_meta.name), error=e)
|
|
496
|
+
self.errors.append(e)
|
|
497
|
+
|
|
484
498
|
except Exception as e:
|
|
485
499
|
self.logger.exception(
|
|
486
500
|
f"Unexpected error while uploading file: {file_meta.external_id} {file_meta.name}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "cognite-extractor-utils"
|
|
3
|
-
version = "7.5.
|
|
3
|
+
version = "7.5.11"
|
|
4
4
|
description = "Utilities for easier development of extractors for CDF"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Mathias Lohne", email = "mathias.lohne@cognite.com"}
|
|
@@ -19,7 +19,7 @@ dependencies = [
|
|
|
19
19
|
"prometheus-client>=0.7.0,<=1.0.0",
|
|
20
20
|
"arrow>=1.0.0",
|
|
21
21
|
"pyyaml>=5.3.0,<7",
|
|
22
|
-
"dacite>=1.6.0",
|
|
22
|
+
"dacite>=1.6.0,<1.9.0",
|
|
23
23
|
"psutil>=6.0.0",
|
|
24
24
|
"decorator>=5.1.1",
|
|
25
25
|
"more-itertools>=10.0.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/metrics.py
RENAMED
|
File without changes
|
{cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/threading.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cognite_extractor_utils-7.5.9 → cognite_extractor_utils-7.5.11}/cognite/extractorutils/util.py
RENAMED
|
File without changes
|