cognite-extractor-utils 7.5.11__tar.gz → 7.5.13__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.

Files changed (51) hide show
  1. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/PKG-INFO +1 -10
  2. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/README.md +0 -9
  3. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/__init__.py +1 -1
  4. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/base.py +8 -7
  5. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/configtools/loaders.py +5 -3
  6. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader/time_series.py +1 -1
  7. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/pyproject.toml +1 -1
  8. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/.gitignore +0 -0
  9. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/LICENSE +0 -0
  10. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/_inner_util.py +0 -0
  11. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/configtools/__init__.py +0 -0
  12. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/configtools/_util.py +0 -0
  13. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/configtools/elements.py +0 -0
  14. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/configtools/validators.py +0 -0
  15. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/exceptions.py +0 -0
  16. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/metrics.py +0 -0
  17. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/py.typed +0 -0
  18. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/statestore/__init__.py +0 -0
  19. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/statestore/_base.py +0 -0
  20. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/statestore/hashing.py +0 -0
  21. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/statestore/watermark.py +0 -0
  22. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/threading.py +0 -0
  23. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/__init__.py +0 -0
  24. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/configuration/__init__.py +0 -0
  25. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/configuration/exceptions.py +0 -0
  26. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/configuration/loaders.py +0 -0
  27. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/configuration/models.py +0 -0
  28. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/core/__init__.py +0 -0
  29. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/core/_dto.py +0 -0
  30. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/core/_messaging.py +0 -0
  31. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/core/base.py +0 -0
  32. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/core/errors.py +0 -0
  33. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/core/logger.py +0 -0
  34. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/core/restart_policy.py +0 -0
  35. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/core/runtime.py +0 -0
  36. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/core/tasks.py +0 -0
  37. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/scheduling/__init__.py +0 -0
  38. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/scheduling/_scheduler.py +0 -0
  39. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/unstable/scheduling/_schedules.py +0 -0
  40. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader/__init__.py +0 -0
  41. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader/_base.py +0 -0
  42. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader/_metrics.py +0 -0
  43. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader/assets.py +0 -0
  44. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader/data_modeling.py +0 -0
  45. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader/events.py +0 -0
  46. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader/files.py +0 -0
  47. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader/raw.py +0 -0
  48. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader/upload_failure_handler.py +0 -0
  49. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader_extractor.py +0 -0
  50. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/cognite/extractorutils/uploader_types.py +0 -0
  51. {cognite_extractor_utils-7.5.11 → cognite_extractor_utils-7.5.13}/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.11
3
+ Version: 7.5.13
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>
@@ -72,15 +72,6 @@ project, and then set up a poetry environment, git repository, commit hooks with
72
72
  template.
73
73
 
74
74
 
75
- ### Extensions
76
-
77
- Some source systems have a lot in common, such as RESTful APIs or systems exposing as MQTT. We therefore have extensions
78
- to `extractor-utils` tailroed to these protocols. These can be found in separate packages:
79
-
80
- * [REST extension](https://github.com/cognitedata/python-extractor-utils-rest)
81
- * [MQTT extension](https://github.com/cognitedata/python-extractor-utils-mqtt)
82
-
83
-
84
75
  ## Contributing
85
76
 
86
77
  The package is open source under the [Apache 2.0 license](./LICENSE), and contribtuions are welcome.
@@ -39,15 +39,6 @@ project, and then set up a poetry environment, git repository, commit hooks with
39
39
  template.
40
40
 
41
41
 
42
- ### Extensions
43
-
44
- Some source systems have a lot in common, such as RESTful APIs or systems exposing as MQTT. We therefore have extensions
45
- to `extractor-utils` tailroed to these protocols. These can be found in separate packages:
46
-
47
- * [REST extension](https://github.com/cognitedata/python-extractor-utils-rest)
48
- * [MQTT extension](https://github.com/cognitedata/python-extractor-utils-mqtt)
49
-
50
-
51
42
  ## Contributing
52
43
 
53
44
  The package is open source under the [Apache 2.0 license](./LICENSE), and contribtuions are welcome.
@@ -16,7 +16,7 @@
16
16
  Cognite extractor utils is a Python package that simplifies the development of new extractors.
17
17
  """
18
18
 
19
- __version__ = "7.5.11"
19
+ __version__ = "7.5.13"
20
20
  from .base import Extractor
21
21
 
22
22
  __all__ = ["Extractor"]
@@ -22,7 +22,7 @@ from threading import Thread
22
22
  from types import TracebackType
23
23
  from typing import Any, Generic, TypeVar
24
24
 
25
- from dotenv import find_dotenv, load_dotenv
25
+ from dotenv import load_dotenv
26
26
 
27
27
  from cognite.client import CogniteClient
28
28
  from cognite.client.data_classes import ExtractionPipeline, ExtractionPipelineRun
@@ -90,6 +90,7 @@ class Extractor(Generic[CustomConfigClass]):
90
90
  handle_interrupts: bool = True,
91
91
  reload_config_interval: int | None = 300,
92
92
  reload_config_action: ReloadConfigAction = ReloadConfigAction.DO_NOTHING,
93
+ success_message: str = "Successful shutdown",
93
94
  ):
94
95
  self.name = name
95
96
  self.description = description
@@ -104,6 +105,7 @@ class Extractor(Generic[CustomConfigClass]):
104
105
  self.handle_interrupts = handle_interrupts
105
106
  self.reload_config_interval = reload_config_interval
106
107
  self.reload_config_action = reload_config_action
108
+ self.success_message = success_message
107
109
 
108
110
  self.started = False
109
111
  self.configured_logger = False
@@ -218,7 +220,7 @@ class Extractor(Generic[CustomConfigClass]):
218
220
  ExtractionPipelineRun(
219
221
  extpipe_external_id=self.extraction_pipeline.external_id,
220
222
  status="success",
221
- message="Successful shutdown",
223
+ message=self.success_message,
222
224
  )
223
225
  )
224
226
 
@@ -250,12 +252,11 @@ class Extractor(Generic[CustomConfigClass]):
250
252
 
251
253
  if str(os.getenv("COGNITE_FUNCTION_RUNTIME", False)).lower() != "true":
252
254
  # Environment Variables
253
- env_file_path = find_dotenv(usecwd=True)
254
- if env_file_path:
255
- load_dotenv(dotenv_path=env_file_path, override=True)
256
- dotenv_message = f"Successfully ingested environment variables from {env_file_path}"
255
+ env_file_found = load_dotenv(dotenv_path="./.env", override=True)
256
+ if env_file_found:
257
+ dotenv_message = "Successfully ingested environment variables from './.env'"
257
258
  else:
258
- dotenv_message = "No .env file found"
259
+ dotenv_message = "No .env file found at {Path.cwd() / '.env'}"
259
260
  else:
260
261
  dotenv_message = "No .env file imported when using Cognite Functions"
261
262
 
@@ -69,7 +69,7 @@ class KeyVaultLoader:
69
69
  self.client: SecretClient | None = None
70
70
 
71
71
  def _init_client(self) -> None:
72
- from dotenv import find_dotenv, load_dotenv
72
+ from dotenv import load_dotenv
73
73
 
74
74
  if not self.config:
75
75
  raise InvalidConfigError(
@@ -98,8 +98,10 @@ class KeyVaultLoader:
98
98
 
99
99
  _logger.info("Using Azure ClientSecret credentials to access KeyVault")
100
100
 
101
- dotenv_path = find_dotenv(usecwd=True)
102
- load_dotenv(dotenv_path=dotenv_path, override=True)
101
+ env_file_found = load_dotenv("./.env", override=True)
102
+
103
+ if not env_file_found:
104
+ _logger.info(f"Local environment file not found at {Path.cwd() / '.env'}")
103
105
 
104
106
  if all(param in self.config for param in auth_parameters):
105
107
  tenant_id = os.path.expandvars(self.config.get("tenant-id", None))
@@ -72,7 +72,7 @@ def default_time_series_factory(external_id: str, datapoints: DataPointList) ->
72
72
  A TimeSeries object with external_id set, and the is_string automatically detected
73
73
  """
74
74
  is_string = (
75
- isinstance(datapoints[0].get("value"), str) # type: ignore # input might be dict to keep compatibility
75
+ isinstance(datapoints[0].get("value"), str)
76
76
  if isinstance(datapoints[0], dict)
77
77
  else isinstance(datapoints[0][1], str)
78
78
  )
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "cognite-extractor-utils"
3
- version = "7.5.11"
3
+ version = "7.5.13"
4
4
  description = "Utilities for easier development of extractors for CDF"
5
5
  authors = [
6
6
  {name = "Mathias Lohne", email = "mathias.lohne@cognite.com"}