amsdal_utils 0.5.4__py3-none-any.whl → 0.5.5__py3-none-any.whl

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.
amsdal_utils/__about__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2023-present
2
2
  #
3
3
  # SPDX-License-Identifier: AMSDAL End User License Agreement
4
- __version__ = '0.5.4'
4
+ __version__ = '0.5.5'
@@ -1,3 +1,4 @@
1
+ from enum import Enum
1
2
  from typing import Any
2
3
 
3
4
  from pydantic import BaseModel
@@ -7,6 +8,20 @@ from pydantic import field_validator
7
8
  DEFAULT_NAME = 'default'
8
9
 
9
10
 
11
+ class ConnectionType(str, Enum):
12
+ """
13
+ Enumeration of connection types.
14
+
15
+ - LAKEHOUSE: Lakehouse database connection with historical tracking
16
+ - STATE: State database connection without historical tracking
17
+ - EXTERNAL_SERVICE: Connection to an external service
18
+ """
19
+
20
+ LAKEHOUSE = 'lakehouse'
21
+ STATE = 'state'
22
+ EXTERNAL_SERVICE = 'external_service'
23
+
24
+
10
25
  class ConnectionConfig(BaseModel):
11
26
  """
12
27
  Configuration model for a connection.
@@ -15,11 +30,15 @@ class ConnectionConfig(BaseModel):
15
30
  name (str): The name of the connection.
16
31
  backend (str): The backend implementation for the connection.
17
32
  credentials (dict[str, Any]): The credentials required for the connection.
33
+ connection_type (ConnectionType): The type of connection (lakehouse, state, external_service).
34
+ is_managed (bool): Whether the connection participates in AMSDAL lifecycle management.
18
35
  """
19
36
 
20
37
  name: str = DEFAULT_NAME
21
38
  backend: str = 'amsdal_data.connections.implementations.iceberg_history.IcebergHistoricalConnection'
22
39
  credentials: dict[str, Any] = Field(default_factory=dict)
40
+ connection_type: ConnectionType = ConnectionType.LAKEHOUSE
41
+ is_managed: bool = True
23
42
 
24
43
  @field_validator('credentials', mode='before')
25
44
  @classmethod
@@ -1,4 +1,5 @@
1
1
  from pydantic import BaseModel
2
+ from pydantic import Field
2
3
 
3
4
  from amsdal_utils.config.data_models.repository_config import RepositoryConfig
4
5
 
@@ -11,9 +12,13 @@ class ResourcesConfig(BaseModel):
11
12
  lakehouse (str): The lakehouse configuration.
12
13
  lock (str): The lock configuration.
13
14
  repository (RepositoryConfig): The repository configuration.
15
+ worker (str): The worker configuration.
16
+ external_services (dict[str, str]): Mapping of service names to connection names for external services.
17
+ Example: {"email": "smtp_connection", "storage": "s3_connection"}
14
18
  """
15
19
 
16
20
  lakehouse: str
17
21
  lock: str | None = None
18
22
  repository: RepositoryConfig | None = None
19
23
  worker: str | None = None
24
+ external_services: dict[str, str] = Field(default_factory=dict)
@@ -26,7 +26,7 @@ class JSONExtendedEncoder(json.JSONEncoder):
26
26
  """Custom JSON encoder to handle additional types."""
27
27
 
28
28
  def default(self, obj: Any) -> Any:
29
- if isinstance(obj, (Decimal, datetime, date, time, bytes)): # noqa: UP038
29
+ if isinstance(obj, (Decimal, datetime, date, time, bytes)):
30
30
  return {
31
31
  '__type__': type(obj).__name__,
32
32
  'value': base64.b64encode(obj).decode('utf-8') if isinstance(obj, bytes) else str(obj),
@@ -91,7 +91,7 @@ def process_one_of(data: dict[str, Any]) -> dict[str, Any]:
91
91
 
92
92
 
93
93
  def process_any_of(data: dict[str, Any], info: ValidationInfo) -> dict[str, Any]:
94
- from amsdal_utils.schemas.schema import PropertyData
94
+ from amsdal_utils.schemas.schema import PropertyData # noqa: PLC0415
95
95
 
96
96
  _any_of = data.pop('anyOf')
97
97
  if _any_of in [[{'$ref': '#/$defs/Reference'}], [{'$ref': '#/$defs/Reference'}, {'type': 'null'}]]:
@@ -42,7 +42,7 @@ class Metadata(BaseModel):
42
42
 
43
43
  @property
44
44
  def address(self) -> Address:
45
- from amsdal_utils.config.manager import AmsdalConfigManager
45
+ from amsdal_utils.config.manager import AmsdalConfigManager # noqa: PLC0415
46
46
 
47
47
  _class_name = self.class_schema_reference.ref.object_id
48
48
 
@@ -77,3 +77,6 @@ class Q:
77
77
  and self.connector == __value.connector
78
78
  and self.negated == __value.negated
79
79
  )
80
+
81
+ def __hash__(self) -> int:
82
+ return hash((self.connector, self.negated, tuple(self.children)))
@@ -7,7 +7,7 @@ T = TypeVar('T')
7
7
 
8
8
 
9
9
  class Singleton(type, Generic[T]):
10
- __instances: ClassVar[dict[type[T], T]] = {} # type: ignore[misc]
10
+ __instances: ClassVar[dict[type[T], T]] = {}
11
11
 
12
12
  def __call__(
13
13
  cls: type[T],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amsdal_utils
3
- Version: 0.5.4
3
+ Version: 0.5.5
4
4
  Summary: Utils for AMSDAL data framework
5
5
  Project-URL: Documentation, https://pypi.org/project/amsdal_utils/#readme
6
6
  Project-URL: Issues, https://pypi.org/project/amsdal_utils/#issues
@@ -1,5 +1,5 @@
1
1
  amsdal_utils/Third-Party Materials - AMSDAL Dependencies - License Notices.md,sha256=blZRsT9Qg4u4LzZuxlWQOzlWGpLAg7DugWS6nz7s_yw,62595
2
- amsdal_utils/__about__.py,sha256=Wtwe0oKsI5yPYO-Bi6bO-d5lQqCSshnr9G6Vx7i__Vg,124
2
+ amsdal_utils/__about__.py,sha256=EPO0yn5_cRRN4L7o2A8njb26ZvPG7OJ4hIGTxQSuB6o,124
3
3
  amsdal_utils/__init__.py,sha256=EQCJ5OevmkkIpIULumPNIbWk3UI7afDfRzIsZN5mfwg,73
4
4
  amsdal_utils/errors.py,sha256=P90oGdKczHZzHukWnzJfbsSxMC-Sc8dUXvHzP7b1IIA,129
5
5
  amsdal_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -12,10 +12,10 @@ amsdal_utils/config/enums.py,sha256=uvc5TjL5zc_nwz3-avFW4zXQsI6cmc_kyJ0nES82--g,
12
12
  amsdal_utils/config/manager.py,sha256=0_aJYCTRSos1PmVPDCNooz_hIX0NR7ce3dXKqoRQmeE,2709
13
13
  amsdal_utils/config/data_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  amsdal_utils/config/data_models/amsdal_config.py,sha256=tOQP6ab8dqdfdM34Q2znf-Lch4VqvtXhkm5RFkC2HiE,1975
15
- amsdal_utils/config/data_models/connection_config.py,sha256=Q6-uXhxsPlb4migy-RGttOsxtkEUbTkGsah9UnWZdmA,1381
15
+ amsdal_utils/config/data_models/connection_config.py,sha256=bUb0dvWVVOXsLV-A37WvGOOeh-t0KJ3NTLHAJFn3OM4,2069
16
16
  amsdal_utils/config/data_models/integration_config.py,sha256=UhFUhEchDY5PPrGiFfmisLkslVtKfiac3BMiU77FoT4,387
17
17
  amsdal_utils/config/data_models/repository_config.py,sha256=Mrqzki0cYMNJI2mywD4BTNSl438B-Jlmy7LqyNZ6I_o,383
18
- amsdal_utils/config/data_models/resources_config.py,sha256=ZAx7nERr1Q5FRxFNUZfOjwTR4PrFWS505AOKMgVGT7I,511
18
+ amsdal_utils/config/data_models/resources_config.py,sha256=RrCCThE7hj8Tr5Nn_ItsRAAnkMBuest2kNWnRL84exk,844
19
19
  amsdal_utils/lifecycle/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  amsdal_utils/lifecycle/consumer.py,sha256=IzA4peJwAQ5knaU11TwkHsLX7KIq9EOdPF2kEzu8DJI,739
21
21
  amsdal_utils/lifecycle/enum.py,sha256=0bmmU1XmyJaxztxVnYIzwzT9Iyzc-s3jUvmk5JcuaYw,500
@@ -24,10 +24,10 @@ amsdal_utils/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
24
24
  amsdal_utils/models/base.py,sha256=jcY7ZE6n0lANGjg87sEwlz6val_8ZRHWaCmNZo9Oxnc,1642
25
25
  amsdal_utils/models/enums.py,sha256=1iuixjmfHMIMDM3rEQ1YUjOPF3aV_OEoPq61I61KvGI,745
26
26
  amsdal_utils/models/data_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
- amsdal_utils/models/data_models/address.py,sha256=haQmHYfQcQdejgM1KrNIylfNS-0R0KEDH4v2I8sjIWo,6600
28
- amsdal_utils/models/data_models/core.py,sha256=yRRJsUIafv2yPnxpZXLTmdbO1Pcv_WgIQVy3IDISGYk,8629
27
+ amsdal_utils/models/data_models/address.py,sha256=zKAGlXjw8oGJrADyhwE8BhYzCEUTSChMSApMYOL7Bjk,6585
28
+ amsdal_utils/models/data_models/core.py,sha256=8cJaA8Xzl4yLpBKZ0CdmW1AO31LZy7Ja_umGUKHNNmU,8646
29
29
  amsdal_utils/models/data_models/enums.py,sha256=qDJDPU5oxPlSNENFNf3PPgxiFJYbTM8OOE8stMmYYHc,4130
30
- amsdal_utils/models/data_models/metadata.py,sha256=J9r7K2_coE2qD3au-Y7wS2YXcjMUOkW_kx3Gubr3Oyg,2979
30
+ amsdal_utils/models/data_models/metadata.py,sha256=z0u7kJzzNj8FxFXozVCcFfwyJFdto6_CgwXnW5TicB4,2996
31
31
  amsdal_utils/models/data_models/reference.py,sha256=hA-06Dq64oMVNv6L6DIelpraxpQJAPiHf4_3UqLmuw4,5098
32
32
  amsdal_utils/models/data_models/table_schema.py,sha256=dYPMw5O4SrD4AkBA0XpMtIgA_QK7fkk0CkmCQ8b_ckg,3292
33
33
  amsdal_utils/models/data_models/transaction.py,sha256=nGxIugmLxbcJ3PMGI5ArfwuVRCn_r1U3sq1EtGimblI,1615
@@ -41,7 +41,7 @@ amsdal_utils/query/enums.py,sha256=B9HLjDI_zdP0JnKjr1r19t2-BvpFZS5JKp9WqhEgvww,1
41
41
  amsdal_utils/query/mixin.py,sha256=B76wHvTV842QHfsrIWE_25vniVxvIBpTII3qHvngnus,470
42
42
  amsdal_utils/query/pull_out_filter.py,sha256=__9YSPJq_cgi6OPWJPPlsJWvtc9B9fVnScUatOMctg8,1459
43
43
  amsdal_utils/query/split.py,sha256=Un8_Zq8sGPA1O87csJWyPdnloUjXrGmD9VQ-b9oFIFQ,1677
44
- amsdal_utils/query/utils.py,sha256=5Tul8ZDYuStrjCaTiW1aJy_sQqs_E9fzDBfkcIJMjRs,2184
44
+ amsdal_utils/query/utils.py,sha256=PQdou7oE_zYWEZMwG9kpov4TC5KWsexhZkVi2IbaQNM,2290
45
45
  amsdal_utils/query/data_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
46
  amsdal_utils/query/data_models/filter.py,sha256=jUTothZBX9w-fLaC-GxyzGBWj6U62iMxrVeE9LrAC9E,2046
47
47
  amsdal_utils/query/data_models/order_by.py,sha256=1SDsafCluIdH93XKCCjHwHirdkO2ePOA4L2FHpa4UQM,983
@@ -55,9 +55,9 @@ amsdal_utils/utils/classes.py,sha256=GeJIt-jxOHgMnlEHMmzNk9vwxv4_V5dLP-Fv89hN5hc
55
55
  amsdal_utils/utils/decorators.py,sha256=RCWbbQJ2hY2s-uAI0C5M0X8gTXqUbL1Gx9NxACYBMOA,992
56
56
  amsdal_utils/utils/identifier.py,sha256=oP3CHd2i8EBHMVUC8DWLr9pFZBt1IdH7Falaa3M26_I,91
57
57
  amsdal_utils/utils/lazy_object.py,sha256=eIVHBDNCSHKQopzYjviPCuh0svbRJQOCZ8KzqFLiS-s,2115
58
- amsdal_utils/utils/singleton.py,sha256=DbgQVJdeftO8sGVm2ti4zf4KDaDd2ogclO3B6gxfqag,744
58
+ amsdal_utils/utils/singleton.py,sha256=O42jKH0jOdfcPGz-OHqfm7kShEZQwUanu3rMHQJSsb0,722
59
59
  amsdal_utils/utils/text.py,sha256=4L5aICJGbmFZwNUhMrACb5thqmcIaWb3aVD24lW24a0,1962
60
- amsdal_utils-0.5.4.dist-info/METADATA,sha256=-_nDjQ2zlovW2aaWGLm7TvEDlYxQNCTUEccNNtDA6ZM,57431
61
- amsdal_utils-0.5.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
62
- amsdal_utils-0.5.4.dist-info/licenses/LICENSE.txt,sha256=hG-541PFYfNJi9WRZi_hno91UyqNg7YLK8LR3vLblZA,27355
63
- amsdal_utils-0.5.4.dist-info/RECORD,,
60
+ amsdal_utils-0.5.5.dist-info/METADATA,sha256=ilvgvJXOYy1N_-acJ7UUkImF_ZQTrKz2m8KMn5tHjAI,57431
61
+ amsdal_utils-0.5.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
62
+ amsdal_utils-0.5.5.dist-info/licenses/LICENSE.txt,sha256=hG-541PFYfNJi9WRZi_hno91UyqNg7YLK8LR3vLblZA,27355
63
+ amsdal_utils-0.5.5.dist-info/RECORD,,