holado 0.6.1__py3-none-any.whl → 0.6.2__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.

Potentially problematic release.


This version of holado might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: holado
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: HolAdo framework
5
5
  Project-URL: Homepage, https://gitlab.com/holado_framework/python
6
6
  Project-URL: Issues, https://gitlab.com/holado_framework/python/-/issues
@@ -157,12 +157,12 @@ holado_db/tools/db/db_manager.py,sha256=0llXc6YhXfLr6oNfncPNjh4_ZInIm8XYywutQYvv
157
157
  holado_db/tools/db/clients/base/db_audit.py,sha256=eJ1r_0YUhvq50JngpWAdyEeVHWjAD4YCvWCJsLc1zmc,4368
158
158
  holado_db/tools/db/clients/base/db_client.py,sha256=sdMKDbnhO0zMCxq3n6vHcn5d5Asm6N5WhKDss89v_PU,15298
159
159
  holado_db/tools/db/clients/postgresql/postgresql_audit.py,sha256=yoy4-Yt4lZHJw7xAcuTj2Thg4aTDCYJBt-6HzQeEE80,3939
160
- holado_db/tools/db/clients/postgresql/postgresql_client.py,sha256=40UOniOJS-2Jrl-lxCSPTn32JGmblO-WqRFQYV40srk,4246
160
+ holado_db/tools/db/clients/postgresql/postgresql_client.py,sha256=FW9t4kGh3ClDr1NfOymSMAYSrguPcKeqbwE6BM4ognI,4746
161
161
  holado_db/tools/db/clients/sqlite/sqlite_audit.py,sha256=cK7hBE7aKCFOX5xnT-QnYD_1loQPgPP9Gf6qTT1XuI4,3966
162
162
  holado_db/tools/db/clients/sqlite/sqlite_client.py,sha256=-EvKAeaOc1Iv_wmuAgvzpS5hEfDFvZgP9OkFc9L5M-s,2891
163
163
  holado_db/tools/db/query/query_manager.py,sha256=7n-d_Q373hlsKQshY3accIH8XfqaLScqnhMdTT2oWC4,3642
164
164
  holado_db/tools/db/query/base/query_builder.py,sha256=-nCyBe8zsRhOX39uCV0P7OY_YKobQJVIpJDL2sUA_H8,5926
165
- holado_db/tools/db/query/pypika/pypika_query_builder.py,sha256=qwFtd-7dSRju-qwGkiaDPwSkNgYpdfKsunq-TM3HhI8,10988
165
+ holado_db/tools/db/query/pypika/pypika_query_builder.py,sha256=9x2-7B4p3eXSq3vLWWLscoFWJZakhcPxmNrpGR2ysdw,10964
166
166
  holado_django/__init__.py,sha256=KpbIi2cm1BYZgoWf0LuhE0ei3ZCE15UcUtjC1cSA55M,1653
167
167
  holado_django/server/HOWTO.txt,sha256=91z7uC1Hf_X6dNO2wxdqQFKG2U6wIIW6NKxirUglYOA,2085
168
168
  holado_django/server/django_server.py,sha256=2nVH0WX99nGGH-c4QztfoC-zAJKmLrNTXvhTp4qsL08,4557
@@ -605,7 +605,7 @@ test_holado/tools/django/api_rest/api_rest/api1/serializers.py,sha256=o_YxFr-tgC
605
605
  test_holado/tools/django/api_rest/api_rest/api1/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
606
606
  test_holado/tools/django/api_rest/api_rest/api1/views.py,sha256=kOt2xT6bxO47_z__5yYR9kcYIWWv4qYzpX0K8Tqonik,758
607
607
  test_holado/tools/django/api_rest/api_rest/api1/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
608
- holado-0.6.1.dist-info/METADATA,sha256=nl2iztCdJ0mOo7toB80StmBvh9zgy8SOSrfi17-7SS0,6166
609
- holado-0.6.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
610
- holado-0.6.1.dist-info/licenses/LICENSE,sha256=IgGmNlcFHnbp7UWrLJqAFvs_HIgjJDTmjCNRircJLsk,1070
611
- holado-0.6.1.dist-info/RECORD,,
608
+ holado-0.6.2.dist-info/METADATA,sha256=-BSf1eXEHFtbGEN1IB-KhCayPLGj-uBMe1OVN9OlXRU,6166
609
+ holado-0.6.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
610
+ holado-0.6.2.dist-info/licenses/LICENSE,sha256=IgGmNlcFHnbp7UWrLJqAFvs_HIgjJDTmjCNRircJLsk,1070
611
+ holado-0.6.2.dist-info/RECORD,,
@@ -15,9 +15,9 @@ import logging
15
15
  from holado_db.tools.db.clients.base.db_client import DBClient
16
16
  from holado_core.common.tables.table_with_header import TableWithHeader
17
17
  from holado_core.common.tools.tools import Tools
18
- import json
19
- from pypika.terms import Function, LiteralValue
20
18
  from holado_db.tools.db.clients.postgresql.postgresql_audit import PostgreSQLTriggerAuditManager
19
+ from holado_db.tools.db.query.pypika.pypika_query_builder import PypikaQueryBuilder
20
+ from holado_core.common.exceptions.technical_exception import TechnicalException
21
21
 
22
22
  logger = logging.getLogger(__name__)
23
23
 
@@ -29,11 +29,13 @@ except Exception as exc:
29
29
  logger.debug(f"PostgreSQLClient is not available. Initialization failed on error: {exc}")
30
30
  with_psycopg = False
31
31
 
32
-
33
- # from pypika import Function
34
- class JsonbSet(Function):
35
- def __init__(self, name, *args, **kwargs):
36
- super().__init__('jsonb_set', LiteralValue(name), *args, **kwargs)
32
+ if PypikaQueryBuilder.is_available():
33
+ from pypika.terms import Function, LiteralValue
34
+
35
+ # from pypika import Function
36
+ class JsonbSet(Function):
37
+ def __init__(self, name, *args, **kwargs):
38
+ super().__init__('jsonb_set', LiteralValue(name), *args, **kwargs)
37
39
 
38
40
 
39
41
  class PostgreSQLClient(DBClient):
@@ -72,6 +74,9 @@ class PostgreSQLClient(DBClient):
72
74
  if isinstance(result, TableWithHeader) and result[0][0].content is not None:
73
75
  is_key_set = json_key in result[0][0].content
74
76
  if is_key_set:
77
+ if not PypikaQueryBuilder.is_available():
78
+ # Note: This case cannot appear currently (04/08/2025), but can appear if another QueryBuilder is managed that is not using pypika
79
+ raise TechnicalException(f"Missing dependence: pypika")
75
80
  self.update(table_name, {field_name: JsonbSet(f'{field_name}', f'{{"{json_key}"}}', f'"{json_value}"')}, where_data=where_data, where_compare_data=where_compare_data, do_commit=True)
76
81
  else:
77
82
  self.update(table_name, {field_name: f'{field_name} || {{"{json_key}":"{json_value}"}}'}, where_data=where_data, where_compare_data=where_compare_data, do_commit=True)
@@ -16,7 +16,6 @@ from holado_core.common.exceptions.technical_exception import TechnicalException
16
16
  from holado_db.tools.db.query.base.query_builder import QueryBuilder, DBCompareOperator
17
17
  from holado_core.common.tools.tools import Tools
18
18
  from holado_python.standard_library.typing import Typing
19
- from pypika.terms import Function
20
19
 
21
20
 
22
21
  logger = logging.getLogger(__name__)
@@ -24,7 +23,7 @@ logger = logging.getLogger(__name__)
24
23
  try:
25
24
  import pypika.functions
26
25
  from pypika.queries import Table, Query
27
- from pypika.terms import Parameter
26
+ from pypika.terms import Parameter, Function
28
27
  with_pypika = True
29
28
  except Exception as exc:
30
29
  if Tools.do_log(logger, logging.DEBUG):
File without changes