nci-cidc-schemas 0.27.9__py2.py3-none-any.whl → 0.27.10__py2.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 nci-cidc-schemas might be problematic. Click here for more details.

cidc_schemas/__init__.py CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  __author__ = """NCI"""
4
4
  __email__ = "nci-cidc-tools-admin@mail.nih.gov"
5
- __version__ = "0.27.09"
5
+ __version__ = "0.27.10"
@@ -106,8 +106,22 @@ class _Validator(jsonschema.Draft7Validator):
106
106
  if "matched_paths" in search:
107
107
  for path in search["matched_paths"]:
108
108
  scope = {"root": self.schema}
109
- exec(f"ref_path_pattern = {path}", scope)
110
- ref_path_pattern = scope["ref_path_pattern"]
109
+ try:
110
+ ref_path_pattern = eval(path, scope)
111
+ except Exception as e:
112
+ raise RuntimeError(
113
+ f"Failed to evaluate in_doc_ref_pattern at path '{path}': {e}"
114
+ ) from e
115
+
116
+ # protect against None cache
117
+ if self._in_doc_refs_cache is None:
118
+ print(f"_in_doc_refs_cache: {self._in_doc_refs_cache}")
119
+ print(f"scope '{scope}'")
120
+ raise RuntimeError(
121
+ "Internal error: _in_doc_refs_cache is None when trying to build cache. "
122
+ "This usually means the validation context was improperly set up."
123
+ )
124
+
111
125
  # If there are no cached values for this ref path pattern, collect them
112
126
  if ref_path_pattern not in self._in_doc_refs_cache:
113
127
  self._in_doc_refs_cache[ref_path_pattern] = (
@@ -116,7 +130,6 @@ class _Validator(jsonschema.Draft7Validator):
116
130
  )
117
131
  )
118
132
 
119
- # see: https://docs.python.org/3/library/contextlib.html
120
133
  try:
121
134
  yield
122
135
  finally:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nci_cidc_schemas
3
- Version: 0.27.9
3
+ Version: 0.27.10
4
4
  Summary: The CIDC data model and tools for working with it.
5
5
  Home-page: https://github.com/NCI-CIDC/cidc-schemas
6
6
  Author: NCI
@@ -1,7 +1,7 @@
1
- cidc_schemas/__init__.py,sha256=MeM_c2q3soiProYuRKkz2LXkVeABgnSd8bmKvCUheOQ,136
1
+ cidc_schemas/__init__.py,sha256=CNRBwX2Hba3M5la6V032DEO4wjN3K9NFqIHiehMhU54,136
2
2
  cidc_schemas/cli.py,sha256=gWiktRlraNH8Q0zNUae9dohKjPwBmcY0BJwdcQ_fIic,4099
3
3
  cidc_schemas/constants.py,sha256=RULs7pGuBAVq1teXymrfbVsK23ZowJvLuZlv0KcjL-Y,698
4
- cidc_schemas/json_validation.py,sha256=nHkSfTmBN7EeTrZVdbb8h6A64lWrJe5z0AIHiIy-YB0,22552
4
+ cidc_schemas/json_validation.py,sha256=BcwWg9cjg3aaFkGIDQyXHpYZGB8IRRzPVvurLXlQiVw,23161
5
5
  cidc_schemas/migrations.py,sha256=Amg_T4cFgMzySD7yNnT_PWpqP7hwlTWGeHlI_RSXuRI,14766
6
6
  cidc_schemas/template.py,sha256=uvQNbkvusMq9D_1cnUMxT7j7Rf-iqq7o5nuZUhCaXY0,51428
7
7
  cidc_schemas/template_reader.py,sha256=xXtLRKu1y4FrPj8RgyGOmB2hlsCDXcuvMBWami2_jV8,13119
@@ -154,9 +154,9 @@ cidc_schemas/schemas/templates/manifests/tissue_slide_template.json,sha256=q2GmO
154
154
  cidc_schemas/schemas/templates/manifests/tumor_normal_pairing_template.json,sha256=lVJrGb28n-vyfjGBzhrzjn1lMKw1b4HXXmWtwA603v0,2797
155
155
  cidc_schemas/schemas/templates/manifests/tumor_tissue_dna_template.json,sha256=LpaoDXDS11NCa-Dv37N-tzEGomswQrx5fypkUcG7xJk,18956
156
156
  cidc_schemas/schemas/templates/manifests/tumor_tissue_rna_template.json,sha256=-gww6NCHbtbI5z7UmNSmKyPK3IqKCE8F6n4XwTAb_gk,18101
157
- nci_cidc_schemas-0.27.9.dist-info/licenses/LICENSE,sha256=zK77-w4rYCZBHAYJEGkcFuPXwKIsP7jMPZ2iQOXjzko,1072
158
- nci_cidc_schemas-0.27.9.dist-info/METADATA,sha256=NUnDS-D4-ulcj0l6fpp2VPhdjOraCbx2h92kOYcuxU4,4553
159
- nci_cidc_schemas-0.27.9.dist-info/WHEEL,sha256=MAQBAzGbXNI3bUmkDsiV_duv8i-gcdnLzw7cfUFwqhU,109
160
- nci_cidc_schemas-0.27.9.dist-info/entry_points.txt,sha256=kSyTzXeJQrJp_2ZX0GS_NnbJR8ceQKLBSgER46PM0hs,55
161
- nci_cidc_schemas-0.27.9.dist-info/top_level.txt,sha256=Wwb5Cu7QrnbmSJxI2d00e3-Mir36t0jTRnSulmfhi30,13
162
- nci_cidc_schemas-0.27.9.dist-info/RECORD,,
157
+ nci_cidc_schemas-0.27.10.dist-info/licenses/LICENSE,sha256=zK77-w4rYCZBHAYJEGkcFuPXwKIsP7jMPZ2iQOXjzko,1072
158
+ nci_cidc_schemas-0.27.10.dist-info/METADATA,sha256=M2wECfycUwM55Xfm1hUrueC0IOscCc1zmQhnbEQAObs,4554
159
+ nci_cidc_schemas-0.27.10.dist-info/WHEEL,sha256=AeO2BvogYWm3eGaHCvhzmUYt8ia7KfURiHzO_1atlys,109
160
+ nci_cidc_schemas-0.27.10.dist-info/entry_points.txt,sha256=kSyTzXeJQrJp_2ZX0GS_NnbJR8ceQKLBSgER46PM0hs,55
161
+ nci_cidc_schemas-0.27.10.dist-info/top_level.txt,sha256=Wwb5Cu7QrnbmSJxI2d00e3-Mir36t0jTRnSulmfhi30,13
162
+ nci_cidc_schemas-0.27.10.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any