thds.mops 3.8.20250603165938__py3-none-any.whl → 3.8.20250604141218__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.
@@ -3,6 +3,7 @@ data and also functions."""
3
3
 
4
4
  import inspect
5
5
  import io
6
+ import os
6
7
  import pickle
7
8
  import typing as ty
8
9
  from functools import partial
@@ -162,12 +163,35 @@ class SourceArgumentPickler:
162
163
  return None
163
164
 
164
165
 
166
+ class DuplicateSourceBasenameError(ValueError):
167
+ pass
168
+
169
+
165
170
  class SourceResultPickler:
166
171
  """Only for use on the remote side, when serializing the result."""
167
172
 
173
+ def __init__(self) -> None:
174
+ """There will be one of these per remote function call."""
175
+ self._basenames_seen: set[str] = set()
176
+
168
177
  def __call__(self, maybe_source: ty.Any) -> ty.Optional[_DeserSource]:
169
178
  if isinstance(maybe_source, source.Source):
170
- return ty.cast(_DeserSource, UnpickleSourceResult(*prepare_source_result(maybe_source)))
179
+ src_res = prepare_source_result(maybe_source)
180
+ if src_res.file_uri:
181
+ # we need to check to make sure that this file_uri is not a duplicate
182
+ # - if it is, this indicates that this single function is attempting to return
183
+ # two Source objects that have not yet been uploaded but will be uploaded to the same name.
184
+ file_basename = os.path.basename(src_res.file_uri)
185
+ if file_basename in self._basenames_seen:
186
+ raise DuplicateSourceBasenameError(
187
+ f"Duplicate basename {os.path.basename(src_res.file_uri)} found in SourceResultPickler."
188
+ " This is usually an indication that you have two files with the same name in two different directories,"
189
+ " and are trying to convert them into Source objects with automatically-assigned URIs."
190
+ " Per the documentation, all output Source objects without explicitly assigned remote URIs must be provided"
191
+ " with unique basenames, in order to allow retention of the basename for usability and debugging."
192
+ )
193
+ self._basenames_seen.add(file_basename)
194
+ return ty.cast(_DeserSource, UnpickleSourceResult(*src_res))
171
195
 
172
196
  return None
173
197
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thds.mops
3
- Version: 3.8.20250603165938
3
+ Version: 3.8.20250604141218
4
4
  Summary: ML Ops tools for Trilliant Health
5
5
  Author-email: Trilliant Health <info@trillianthealth.com>
6
6
  Project-URL: Repository, https://github.com/TrilliantHealth/ds-monorepo
@@ -82,7 +82,7 @@ thds/mops/pure/joblib/__init__.py,sha256=-3hSs-GsNzE_eNnwrdZBHAR_eaub5Uyl5GPYqBw
82
82
  thds/mops/pure/joblib/backend.py,sha256=F__6lrdc1-VcX4n4Pw7Lz1bBgeefShtRy2DQh6Fp-eI,2671
83
83
  thds/mops/pure/joblib/batching.py,sha256=tPOATD28-YW7KcWa3IqKm-fhLaILzM792ApvU-_zfnM,2298
84
84
  thds/mops/pure/pickling/__init__.py,sha256=WNdG8PdJCk-kYaXkvvPa--hjYGoUlBXG3w2X86yuhGo,156
85
- thds/mops/pure/pickling/_pickle.py,sha256=vn8f6uEsaAdLyxGNYb4ED6D1a6BXsZQxnV3c0Ya6WUk,7605
85
+ thds/mops/pure/pickling/_pickle.py,sha256=Q4dd683OPsdb_4oQRDWJ9F8mN_jKIXxgySCikAABVTE,9043
86
86
  thds/mops/pure/pickling/memoize_only.py,sha256=oI5CMy6IEJc46Gb_BGWNUuAe3fysS7HxRSTajN0WssI,837
87
87
  thds/mops/pure/pickling/mprunner.py,sha256=dVbwQA8hzEL7UiwYXmzoGwN3_jbEtGoHDPMkRmo_UtA,8378
88
88
  thds/mops/pure/pickling/pickles.py,sha256=nCg7L7CqReNWDF8FAdEmCcuXVC_kLT5zuyW3V8Vvvs4,4704
@@ -105,8 +105,8 @@ thds/mops/pure/tools/summarize/cli.py,sha256=7kDtn24ok8oBO3jFjlMmOK3jnZYpMoE_5Y8
105
105
  thds/mops/pure/tools/summarize/run_summary.py,sha256=LUtvbankAYbss2NCF_XbNl05jkNgxYz_SLyERJlp4sk,5773
106
106
  thds/mops/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
107
  thds/mops/testing/deferred_imports.py,sha256=f0ezCgQAtzTqW1yAOb0OWgsB9ZrlztLB894LtpWDaVw,3780
108
- thds_mops-3.8.20250603165938.dist-info/METADATA,sha256=SebuJztesDKcsRUOo6rf---yjdjihCg9V0QmLxBeqSA,2222
109
- thds_mops-3.8.20250603165938.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
110
- thds_mops-3.8.20250603165938.dist-info/entry_points.txt,sha256=GShNqjcjbq0TAJuwpyeCI5XCltiwdZxnNHkBpmYbNkU,329
111
- thds_mops-3.8.20250603165938.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
112
- thds_mops-3.8.20250603165938.dist-info/RECORD,,
108
+ thds_mops-3.8.20250604141218.dist-info/METADATA,sha256=s1CmuiNviUh-Psk1NG5jdE1ndCzQlZQm9vOB1OuqCE4,2222
109
+ thds_mops-3.8.20250604141218.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
110
+ thds_mops-3.8.20250604141218.dist-info/entry_points.txt,sha256=qKvCAaB80syXfxVR3xx6x9J0YJdaQWkIbVSw-NwFgMw,322
111
+ thds_mops-3.8.20250604141218.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
112
+ thds_mops-3.8.20250604141218.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  [console_scripts]
2
- krsync = thds.mops.k8s.orchestrator.krsync:main
2
+ krsync = thds.mops.k8s.tools.krsync:main
3
3
  mops-exit-after = thds.core.exit_after:main
4
4
  mops-human-sha256b64 = thds.mops.pure.tools.sha256_b64_addressed:main
5
5
  mops-inspect = thds.mops.pure.tools.inspect:main