pydpm_xl 0.2.7__py3-none-any.whl → 0.2.8__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.
py_dpm/__init__.py CHANGED
@@ -41,7 +41,7 @@ Available packages:
41
41
  - pydpm.api: Main APIs for migration, syntax, and semantic analysis
42
42
  """
43
43
 
44
- __version__ = "0.2.7"
44
+ __version__ = "0.2.8"
45
45
  __author__ = "MeaningfulData S.L."
46
46
  __email__ = "info@meaningfuldata.eu"
47
47
  __license__ = "GPL-3.0-or-later"
py_dpm/dpm/utils.py CHANGED
@@ -117,6 +117,13 @@ def create_engine_from_url(connection_url, pool_config=None):
117
117
  # Detect database type from URL scheme
118
118
  is_sqlite = connection_url.startswith("sqlite://")
119
119
 
120
+ # For PostgreSQL, ensure ISO datestyle if not already set
121
+ # This prevents date parsing errors when PostgreSQL returns dates in locale format
122
+ is_postgres = connection_url.startswith("postgresql://")
123
+ if is_postgres and "datestyle" not in connection_url.lower():
124
+ separator = "&" if "?" in connection_url else "?"
125
+ connection_url = f"{connection_url}{separator}options=-c%20datestyle%3DISO"
126
+
120
127
  # For SQLite URLs, always create a fresh engine to avoid
121
128
  # surprising cross-test or cross-call state sharing, especially
122
129
  # for in-memory databases. For server-based databases, reuse the
@@ -167,6 +174,14 @@ def create_engine_object(url):
167
174
  # Detect database type from URL scheme (not from environment variables)
168
175
  is_sqlite = url_str.startswith("sqlite://")
169
176
 
177
+ # For PostgreSQL, ensure ISO datestyle if not already set
178
+ # This prevents date parsing errors when PostgreSQL returns dates in locale format
179
+ is_postgres = url_str.startswith("postgresql://")
180
+ if is_postgres and "datestyle" not in url_str.lower():
181
+ separator = "&" if "?" in url_str else "?"
182
+ url_str = f"{url_str}{separator}options=-c%20datestyle%3DISO"
183
+ url = url_str # Use modified URL for engine creation
184
+
170
185
  # Only reuse engines for non-SQLite URLs. SQLite (especially in-memory)
171
186
  # should create independent engines to avoid leaking state between calls.
172
187
  if not is_sqlite and engine is not None and _current_engine_url == url_str:
@@ -230,6 +245,7 @@ def get_engine(owner=None, database_path=None, connection_url=None, pool_config=
230
245
  port = db_port or "5432"
231
246
  connection_url = (
232
247
  f"postgresql://{db_user}:{db_password}@{db_host}:{port}/{db_name}"
248
+ "?options=-c%20datestyle%3DISO"
233
249
  )
234
250
  return create_engine_object(connection_url)
235
251
  else:
@@ -277,6 +293,7 @@ def get_engine(owner=None, database_path=None, connection_url=None, pool_config=
277
293
  connection_url = (
278
294
  f"postgresql://{postgres_user}:{postgres_pass}@"
279
295
  f"{postgres_host}:{postgres_port}/{postgres_db}"
296
+ "?options=-c%20datestyle%3DISO"
280
297
  )
281
298
  return create_engine_object(connection_url)
282
299
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydpm_xl
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Python library for DPM-XL data processing and analysis
5
5
  Author-email: "MeaningfulData S.L." <info@meaningfuldata.eu>
6
6
  License: GPL-3.0-or-later
@@ -1,4 +1,4 @@
1
- py_dpm/__init__.py,sha256=a2pLEJ-WUNGj-wIL9gxgvcBpavgpyCKq-DbzJMC2dbA,1858
1
+ py_dpm/__init__.py,sha256=4k-u3wCmXF8WInrw7MzDeJ0E3F7WlfF1uzzPIe-g7vg,1858
2
2
  py_dpm/api/__init__.py,sha256=6ElO0NKEjuqiHNxK7pxkzLNlaUOrYKnY3N0fUDDobik,1021
3
3
  py_dpm/api/dpm/__init__.py,sha256=HQflgiRbs1eDi3KTadNhxS1NoaG6PGQDVMvFnuIEfXo,506
4
4
  py_dpm/api/dpm/data_dictionary.py,sha256=q6w_5bFdc6WPd5Z601PpDaCcnIw39CnI4wdby3GJmFU,29893
@@ -18,7 +18,7 @@ py_dpm/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
18
18
  py_dpm/dpm/__init__.py,sha256=moagUo5Gxf24-Tl9FL_3n2wmVoD_oXtpC-YIGktH_rc,212
19
19
  py_dpm/dpm/migration.py,sha256=ivO_ObvKzVomTns6qfo-o5FuciWxkXbMd_gJ4_tu7Xc,14110
20
20
  py_dpm/dpm/models.py,sha256=Rt1b8zOSayXd9KhwyfkGJVhCai3YxUakmLYgwaiICWA,135660
21
- py_dpm/dpm/utils.py,sha256=lyAZjMVrvVXXNw4e-3J0W6Q6o4YeZTgBtgn6BkPFTfI,13953
21
+ py_dpm/dpm/utils.py,sha256=3w06_kKiFRPqHvRUfN_0nNQIpppfidFybdDge97qzI0,14918
22
22
  py_dpm/dpm/queries/base.py,sha256=EddMeJMwtp63DyyIFO7_XxGvdlCtJQWWpeOVImlKp4I,3648
23
23
  py_dpm/dpm/queries/basic_objects.py,sha256=JOXC235lMDfVENrFAhZAl7_nqePJ4RrwJhFF0WDyk0M,955
24
24
  py_dpm/dpm/queries/explorer_queries.py,sha256=HcLfwpdGWX-q-i1L-7W0nwTxL_0OiDliqPUeoZ9zHZ4,17453
@@ -76,9 +76,9 @@ py_dpm/exceptions/exceptions.py,sha256=6S3p-_i5O1oStvSMixt_JQG0xwTeSfBcdzrwL8yBy
76
76
  py_dpm/exceptions/messages.py,sha256=UwY6QIK8c-POcDCc9HYbZFGArCIYAanUGNh2LNKPx3U,7534
77
77
  py_dpm/instance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
78
  py_dpm/instance/instance.py,sha256=gRSg2dh1nEa0Srx9yKcN3bxiYidvZyRU_jsTNaKkP5I,10882
79
- pydpm_xl-0.2.7.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
80
- pydpm_xl-0.2.7.dist-info/METADATA,sha256=Tg3xyWRxhUd3w1pKuv5iNBYTRq_VkZzIH533JzyaBYQ,9302
81
- pydpm_xl-0.2.7.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
82
- pydpm_xl-0.2.7.dist-info/entry_points.txt,sha256=6DDmBfw-AjtgvMHgq_I730i_LAAs_7-N3C95HD_bRr4,47
83
- pydpm_xl-0.2.7.dist-info/top_level.txt,sha256=495PvWZRoKl2NvbQU25W7dqWIBHqY-mFMPt83uxPpcM,7
84
- pydpm_xl-0.2.7.dist-info/RECORD,,
79
+ pydpm_xl-0.2.8.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
80
+ pydpm_xl-0.2.8.dist-info/METADATA,sha256=lxBecMV5iI2uJ7kYokD9ewnzfV5k6Zprgvb0OdtehF8,9302
81
+ pydpm_xl-0.2.8.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
82
+ pydpm_xl-0.2.8.dist-info/entry_points.txt,sha256=6DDmBfw-AjtgvMHgq_I730i_LAAs_7-N3C95HD_bRr4,47
83
+ pydpm_xl-0.2.8.dist-info/top_level.txt,sha256=495PvWZRoKl2NvbQU25W7dqWIBHqY-mFMPt83uxPpcM,7
84
+ pydpm_xl-0.2.8.dist-info/RECORD,,