dycw-utilities 0.150.3__py3-none-any.whl → 0.150.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dycw-utilities
3
- Version: 0.150.3
3
+ Version: 0.150.4
4
4
  Author-email: Derek Wan <d.wan@icloud.com>
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -1,4 +1,4 @@
1
- utilities/__init__.py,sha256=Cq_2nj3LqfyJTOCefbNBIthJspdy7fVvIQhZzjmrcms,60
1
+ utilities/__init__.py,sha256=5doYSCwWiMG5YyPPH9P5bJMpn_z6Oc2DQ8YaNf9S00k,60
2
2
  utilities/altair.py,sha256=92E2lCdyHY4Zb-vCw6rEJIsWdKipuu-Tu2ab1ufUfAk,9079
3
3
  utilities/asyncio.py,sha256=2m2a2C-Qgc6OHTTHL332-t66A7xDITt_SORT7a1DJWo,16792
4
4
  utilities/atomicwrites.py,sha256=xcOWenTBRS0oat3kg7Sqe51AohNThMQ2ixPL7QCG8hw,5795
@@ -49,7 +49,7 @@ utilities/pickle.py,sha256=MBT2xZCsv0pH868IXLGKnlcqNx2IRVKYNpRcqiQQqxw,653
49
49
  utilities/platform.py,sha256=Ue9LSxYvg9yUXGKuz5aZoy_qkUEXde-v6B09exgSctU,2813
50
50
  utilities/polars.py,sha256=BgiDryAVOapi41ddfJqN0wYh_sDj8BNEYtPB36LaHdo,71824
51
51
  utilities/polars_ols.py,sha256=Uc9V5kvlWZ5cU93lKZ-cfAKdVFFw81tqwLW9PxtUvMs,5618
52
- utilities/postgres.py,sha256=_LJDtzw50gHaPyW8lu_Z9zBh7eXK7A10yx-hJZ0f4nc,13084
52
+ utilities/postgres.py,sha256=4-eE_8GBvcp3oBBMpHp7desQaWF8qxn5ms7cdAaTo2Q,13290
53
53
  utilities/pottery.py,sha256=u0uvyGgYyujxftEMlsv6ppYTKQoVVjHt5jnVxxYz9s4,6596
54
54
  utilities/pqdm.py,sha256=BTsYPtbKQWwX-iXF4qCkfPG7DPxIB54J989n83bXrIo,3092
55
55
  utilities/psutil.py,sha256=KUlu4lrUw9Zg1V7ZGetpWpGb9DB8l_SSDWGbANFNCPU,2104
@@ -89,8 +89,8 @@ utilities/zoneinfo.py,sha256=oEH-nL3t4h9uawyZqWDtNtDAl6M-CLpLYGI_nI6DulM,1971
89
89
  utilities/pytest_plugins/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
90
90
  utilities/pytest_plugins/pytest_randomly.py,sha256=NXzCcGKbpgYouz5yehKb4jmxmi2SexKKpgF4M65bi10,414
91
91
  utilities/pytest_plugins/pytest_regressions.py,sha256=Iwhfv_OJH7UCPZCfoh7ugZ2Xjqjil-BBBsOb8sDwiGI,1471
92
- dycw_utilities-0.150.3.dist-info/METADATA,sha256=-YosBZZgzaXWh9BN49qtUMo75u-PUSeAuTfeM_Q0ES0,1697
93
- dycw_utilities-0.150.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
94
- dycw_utilities-0.150.3.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
95
- dycw_utilities-0.150.3.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
96
- dycw_utilities-0.150.3.dist-info/RECORD,,
92
+ dycw_utilities-0.150.4.dist-info/METADATA,sha256=yXNNi9xSu6WZnpC3l7KS79CBuiN_co1JXgpEmlHEN2A,1697
93
+ dycw_utilities-0.150.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
94
+ dycw_utilities-0.150.4.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
95
+ dycw_utilities-0.150.4.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
96
+ dycw_utilities-0.150.4.dist-info/RECORD,,
utilities/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.150.3"
3
+ __version__ = "0.150.4"
utilities/postgres.py CHANGED
@@ -36,6 +36,7 @@ async def pg_dump(
36
36
  jobs: int | None = None,
37
37
  data_only: bool = False,
38
38
  clean: bool = False,
39
+ create: bool = False,
39
40
  schema: MaybeListStr | None = None,
40
41
  schema_exc: MaybeListStr | None = None,
41
42
  table: MaybeSequence[TableOrORMInstOrClass | str] | None = None,
@@ -57,6 +58,7 @@ async def pg_dump(
57
58
  jobs=jobs,
58
59
  data_only=data_only,
59
60
  clean=clean,
61
+ create=create,
60
62
  schema=schema,
61
63
  schema_exc=schema_exc,
62
64
  table=table,
@@ -106,6 +108,7 @@ def _build_pg_dump(
106
108
  jobs: int | None = None,
107
109
  data_only: bool = False,
108
110
  clean: bool = False,
111
+ create: bool = False,
109
112
  schema: MaybeListStr | None = None,
110
113
  schema_exc: MaybeListStr | None = None,
111
114
  table: MaybeSequence[TableOrORMInstOrClass | str] | None = None,
@@ -127,7 +130,6 @@ def _build_pg_dump(
127
130
  # output options
128
131
  *_resolve_data_only_and_clean(data_only=data_only, clean=clean),
129
132
  "--large-objects",
130
- "--create",
131
133
  "--no-owner",
132
134
  "--no-privileges",
133
135
  # connection options
@@ -137,6 +139,8 @@ def _build_pg_dump(
137
139
  ]
138
140
  if (format_ == "directory") and (jobs is not None):
139
141
  parts.append(f"--jobs={jobs}")
142
+ if create:
143
+ parts.append("--create")
140
144
  if schema is not None:
141
145
  parts.extend([f"--schema={s}" for s in always_iterable(schema)])
142
146
  if schema_exc is not None:
@@ -255,6 +259,7 @@ def _build_pg_restore_or_psql(
255
259
  database: str | None = None,
256
260
  data_only: bool = False,
257
261
  clean: bool = False,
262
+ create: bool = False,
258
263
  jobs: int | None = None,
259
264
  schema: MaybeListStr | None = None,
260
265
  schema_exc: MaybeListStr | None = None,
@@ -271,6 +276,7 @@ def _build_pg_restore_or_psql(
271
276
  database=database,
272
277
  data_only=data_only,
273
278
  clean=clean,
279
+ create=create,
274
280
  jobs=jobs,
275
281
  schemas=schema,
276
282
  schemas_exc=schema_exc,
@@ -288,6 +294,7 @@ def _build_pg_restore(
288
294
  database: str | None = None,
289
295
  data_only: bool = False,
290
296
  clean: bool = False,
297
+ create: bool = False,
291
298
  jobs: int | None = None,
292
299
  schemas: MaybeListStr | None = None,
293
300
  schemas_exc: MaybeListStr | None = None,
@@ -305,7 +312,6 @@ def _build_pg_restore(
305
312
  "--verbose",
306
313
  # restore options
307
314
  *_resolve_data_only_and_clean(data_only=data_only, clean=clean),
308
- "--create",
309
315
  "--exit-on-error",
310
316
  "--no-owner",
311
317
  "--no-privileges",
@@ -314,6 +320,8 @@ def _build_pg_restore(
314
320
  f"--port={port}",
315
321
  "--no-password",
316
322
  ]
323
+ if create:
324
+ parts.append("--create")
317
325
  if jobs is not None:
318
326
  parts.append(f"--jobs={jobs}")
319
327
  if schemas is not None: