datashare-python 0.12.8__py3-none-any.whl → 0.12.10__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.
@@ -858,10 +858,12 @@ class WorkerFile(
858
858
  )
859
859
 
860
860
 
861
- def _file_discriminator(v: Any) -> str:
861
+ def _file_discriminator(v: Any) -> str | None:
862
862
  parent = v.get("parent") if isinstance(v, dict) else getattr(v, "parent", None)
863
863
  if parent is None:
864
- raise ValueError(f"{v} has no parent")
864
+ # No match the parent is neither a DatashareFile of WorkerFile it could be a
865
+ # Document or we're just deserializing something else
866
+ return None
865
867
  if isinstance(parent, dict):
866
868
  is_document = parent.get("type") == "Document"
867
869
  else:
datashare_python/utils.py CHANGED
@@ -905,10 +905,12 @@ class SharedResources:
905
905
  # If refresh needs to happen, we set the value to the sentinel.
906
906
  # The old value will be release with the last user call to _release.
907
907
  # Returning the sentinel will trigger the call to the factory
908
- if (
908
+ refresh = (
909
909
  self._refresh_interval is not None
910
- and self._n_leases[self._vkey(value)] >= self._refresh_interval
911
- ):
910
+ and self._n_leases.get(self._vkey(value), 0)
911
+ >= self._refresh_interval
912
+ )
913
+ if refresh:
912
914
  self._pending_evictions[self._vkey(value)] = (key, value)
913
915
  value = self._sentinel
914
916
  else:
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: datashare-python
3
- Version: 0.12.8
3
+ Version: 0.12.10
4
4
  Summary: Manage Python tasks and local resources in Datashare
5
5
  Project-URL: Homepage, https://icij.github.io/datashare-python/
6
6
  Project-URL: Documentation, https://icij.github.io/datashare-python/
@@ -10,19 +10,19 @@ datashare_python/exceptions.py,sha256=bVHEAXxDPKfxeeMC0hJXEsrJkgsKO2ESAhxWU96GA4
10
10
  datashare_python/interceptors.py,sha256=-XC-y_MvGyHlZQ6jItfMRPAmKwQkQzzncpAGxceKlwM,16485
11
11
  datashare_python/logging_.py,sha256=96KNXhP-JR5ybu9dld4VLtF7v7PfiphOCR1Nio-mmUs,4483
12
12
  datashare_python/mimetypes_.py,sha256=omd2g8JyN-tfZL-lmxbWsjgc987iUe5w87ZpEtbyUK0,49930
13
- datashare_python/objects.py,sha256=mRkqeK_nRJIvfbT5VjsynOl01TNO5JtvxE-ISlJ5T80,26747
13
+ datashare_python/objects.py,sha256=2v83v4A0KcEJxiqQjv1PDDN6XRbEyTKJuGPuMpG4-jU,26874
14
14
  datashare_python/task_client.py,sha256=oTmP8bvZW0UyhLNMi1AV3XIAx7hrdbxNRss2Mw2azEc,8435
15
15
  datashare_python/template.py,sha256=N1uM8TRXh5tQPV7BC1oJj-Pdm2Gs_SkjaXv50RnNYso,4682
16
16
  datashare_python/types_.py,sha256=cPcCkIk6ecILrKetPnAsrb0njHYuWJU3eZicUXy2lF8,1278
17
- datashare_python/utils.py,sha256=4GKVD8jNKwP3cSJ755iwAKMaLQZmKfEZzIW_k2NNTz8,34677
18
- datashare_python/worker-template.tar.gz,sha256=6g18nyWD-c-cPMAeYCVTE0a9dGCezG7d0e2cWYGx_aU,281036
17
+ datashare_python/utils.py,sha256=2Tp0rAgGl3N-_hvZmk09gF22wiVRuciDJKVh0QvruDo,34738
18
+ datashare_python/worker-template.tar.gz,sha256=jBKA_7jB68fjUfdfanOk2T-aLzdolmvmCmQLWmQaB-A,281047
19
19
  datashare_python/worker.py,sha256=ad36_yJOgwtj8KBheWndGkqaP_2aXTPSrYaHrbCXTvg,8389
20
20
  datashare_python/cli/__init__.py,sha256=9BPWtssDgsVfWMsZ1TtZCla0EC_kai4RHttr8oNLYOE,1401
21
21
  datashare_python/cli/project.py,sha256=w32Gy9AOL5B00uDT4in7YUCt2g68FnNbvwg2M3a8G6o,946
22
22
  datashare_python/cli/task.py,sha256=GsyR5o0fN4Pd8tJKAUgivAvCBKT3L4Ay5j_BCW1XBHk,5828
23
23
  datashare_python/cli/utils.py,sha256=p69CQb0zfixuyBkiZprhdMCc_NuYwXyAn6vC9H1UzAw,911
24
24
  datashare_python/cli/worker.py,sha256=x0p3a1_NsZPbmV7-WSVMRyW3_iadYcgyZKbDvWgymQc,5790
25
- datashare_python-0.12.8.dist-info/METADATA,sha256=KzzE356WZIJDxqiWoKfIboHQ4iRizKgHJjO7JJreg1w,1012
26
- datashare_python-0.12.8.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
27
- datashare_python-0.12.8.dist-info/entry_points.txt,sha256=ILE7auxabHWiu3GC-AunWnzjhOI_SbZp7D4GqZHlLw4,68
28
- datashare_python-0.12.8.dist-info/RECORD,,
25
+ datashare_python-0.12.10.dist-info/METADATA,sha256=wK9qxlLYxChw2D5jb4jyfKxl1aLyhy0RsdqpvhqUpn4,1013
26
+ datashare_python-0.12.10.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
27
+ datashare_python-0.12.10.dist-info/entry_points.txt,sha256=ILE7auxabHWiu3GC-AunWnzjhOI_SbZp7D4GqZHlLw4,68
28
+ datashare_python-0.12.10.dist-info/RECORD,,