nci-cidc-api-modules 1.2.6__py3-none-any.whl → 1.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.
- cidc_api/models/models.py +23 -9
- {nci_cidc_api_modules-1.2.6.dist-info → nci_cidc_api_modules-1.2.8.dist-info}/METADATA +2 -2
- {nci_cidc_api_modules-1.2.6.dist-info → nci_cidc_api_modules-1.2.8.dist-info}/RECORD +6 -6
- {nci_cidc_api_modules-1.2.6.dist-info → nci_cidc_api_modules-1.2.8.dist-info}/WHEEL +0 -0
- {nci_cidc_api_modules-1.2.6.dist-info → nci_cidc_api_modules-1.2.8.dist-info}/licenses/LICENSE +0 -0
- {nci_cidc_api_modules-1.2.6.dist-info → nci_cidc_api_modules-1.2.8.dist-info}/top_level.txt +0 -0
cidc_api/models/models.py
CHANGED
@@ -28,6 +28,7 @@ __all__ = [
|
|
28
28
|
"JobFileCategories",
|
29
29
|
"ValidationConfigs",
|
30
30
|
"TRIAL_APPENDIX_A",
|
31
|
+
"TRIAL_APPENDIX_A_CELL_THAT_ENDS_THE_HEADER",
|
31
32
|
"REQUEST_LETTER",
|
32
33
|
"ADMIN_FILE_CATEGORIES",
|
33
34
|
"FINAL_JOB_STATUS",
|
@@ -82,7 +83,6 @@ from sqlalchemy import (
|
|
82
83
|
Boolean,
|
83
84
|
CheckConstraint,
|
84
85
|
Column,
|
85
|
-
Date,
|
86
86
|
DateTime,
|
87
87
|
Enum,
|
88
88
|
ForeignKey,
|
@@ -150,6 +150,10 @@ from ..shared.gcloud_client import (
|
|
150
150
|
os.environ["TZ"] = "UTC"
|
151
151
|
logger = get_logger(__name__)
|
152
152
|
|
153
|
+
# pylint: disable=protected-access,not-callable,no-value-for-parameter,too-many-positional-arguments
|
154
|
+
# pylint: disable=unsubscriptable-object,singleton-comparison,broad-exception-raised,redefined-builtin
|
155
|
+
# pylint: disable=arguments-renamed,logging-fstring-interpolation,disable=comparison-with-callable
|
156
|
+
|
153
157
|
|
154
158
|
class FileGroups:
|
155
159
|
pass
|
@@ -3391,8 +3395,8 @@ class PreprocessedFiles(CommonColumns):
|
|
3391
3395
|
"""
|
3392
3396
|
if job_id is not None:
|
3393
3397
|
return query.filter_by(job_id=job_id)
|
3394
|
-
|
3395
|
-
|
3398
|
+
|
3399
|
+
return query.filter(cls.job_id.is_(None))
|
3396
3400
|
|
3397
3401
|
|
3398
3402
|
INGESTION_JOB_STATUSES = [
|
@@ -3415,6 +3419,7 @@ INGESTION_JOB_COLORS = {
|
|
3415
3419
|
}
|
3416
3420
|
# TODO If have "CANCELLED" concept or other final status, add here
|
3417
3421
|
FINAL_JOB_STATUS = ["PUBLISHED"]
|
3422
|
+
TRIAL_APPENDIX_A_CELL_THAT_ENDS_THE_HEADER = "Entity"
|
3418
3423
|
|
3419
3424
|
|
3420
3425
|
class IngestionJobs(CommonColumns):
|
@@ -3455,16 +3460,16 @@ class IngestionJobs(CommonColumns):
|
|
3455
3460
|
df = gcs_xlsx_or_csv_file_to_pandas_dataframe(GOOGLE_CLINICAL_DATA_BUCKET, appendix_a.object_url)
|
3456
3461
|
categories = []
|
3457
3462
|
headers_ended = False
|
3458
|
-
for
|
3463
|
+
for _index, row in df.iterrows():
|
3459
3464
|
cell = str(row.iloc[0])
|
3460
3465
|
if headers_ended:
|
3461
|
-
if
|
3466
|
+
if cell != "nan" and cell not in categories:
|
3462
3467
|
categories.append(cell)
|
3463
|
-
elif cell ==
|
3468
|
+
elif cell == TRIAL_APPENDIX_A_CELL_THAT_ENDS_THE_HEADER:
|
3464
3469
|
headers_ended = True
|
3465
|
-
if "
|
3470
|
+
if "data_dictionary" not in categories:
|
3466
3471
|
# Ensure Data_Dictionary is always a required file category
|
3467
|
-
categories.append("
|
3472
|
+
categories.append("data_dictionary")
|
3468
3473
|
return categories
|
3469
3474
|
|
3470
3475
|
@classmethod
|
@@ -3608,7 +3613,16 @@ class FileValidationErrors(CommonColumns):
|
|
3608
3613
|
@classmethod
|
3609
3614
|
@with_default_session
|
3610
3615
|
def get_errors_for_job_sorted_by_file_id(cls, job_id: int, session: Session = None) -> list["FileValidationErrors"]:
|
3611
|
-
|
3616
|
+
errors = (
|
3617
|
+
session.query(cls)
|
3618
|
+
.join(PreprocessedFiles)
|
3619
|
+
.filter(PreprocessedFiles.status == "current")
|
3620
|
+
.filter(cls.job_id == job_id)
|
3621
|
+
.order_by(cls.file_id.asc())
|
3622
|
+
.all()
|
3623
|
+
)
|
3624
|
+
|
3625
|
+
return errors
|
3612
3626
|
|
3613
3627
|
|
3614
3628
|
class ValidationConfigs(CommonColumns):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: nci_cidc_api_modules
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.8
|
4
4
|
Summary: SQLAlchemy data models and configuration tools used in the NCI CIDC API
|
5
5
|
Home-page: https://github.com/NCI-CIDC/cidc-api-gae
|
6
6
|
License: MIT license
|
@@ -29,7 +29,7 @@ Requires-Dist: python-dotenv>=1.1.1
|
|
29
29
|
Requires-Dist: requests>=2.32.5
|
30
30
|
Requires-Dist: sqlalchemy>=2.0.43
|
31
31
|
Requires-Dist: werkzeug>=3.1.3
|
32
|
-
Requires-Dist: nci-cidc-schemas==0.28.
|
32
|
+
Requires-Dist: nci-cidc-schemas==0.28.7
|
33
33
|
Dynamic: description
|
34
34
|
Dynamic: description-content-type
|
35
35
|
Dynamic: home-page
|
@@ -5,7 +5,7 @@ cidc_api/config/secrets.py,sha256=jRFj7W43pWuPf9DZQLCKF7WPXf5cUv-BAaS3ASqhV_Q,14
|
|
5
5
|
cidc_api/config/settings.py,sha256=NsJbqW6Vqcz2f79xcAbk4th5tHne_I-RPCbKq_3hpz0,4427
|
6
6
|
cidc_api/models/__init__.py,sha256=bl445G8Zic9YbhZ8ZBni07wtBMhLJRMBA-JqjLxx2bw,66
|
7
7
|
cidc_api/models/migrations.py,sha256=gp9vtkYbA9FFy2s-7woelAmsvQbJ41LO2_DY-YkFIrQ,11464
|
8
|
-
cidc_api/models/models.py,sha256=
|
8
|
+
cidc_api/models/models.py,sha256=8hfETKW-FN27aDmntprcj-4T59oB46oK9sdrll5tprs,146839
|
9
9
|
cidc_api/models/schemas.py,sha256=6IE2dJoEMcMbi0Vr1V3cYKnPKU0hv9vRKBixOZHe88s,2766
|
10
10
|
cidc_api/models/files/__init__.py,sha256=8BMTnUSHzUbz0lBeEQY6NvApxDD3GMWMduoVMos2g4Y,213
|
11
11
|
cidc_api/models/files/details.py,sha256=sZkGM7iEV4-J6IDQCdiMV6KBDLbPxCOqUMaU3aY9rX8,65153
|
@@ -17,8 +17,8 @@ cidc_api/shared/file_handling.py,sha256=l4wiRkVJLL7QbCoODsLx-uki6Km8QoMmUlRVnUV9
|
|
17
17
|
cidc_api/shared/gcloud_client.py,sha256=ETQ34qKtO7l0svVhiHXxXewiyNjwIMgoeVcqrg-Twtk,36902
|
18
18
|
cidc_api/shared/jose.py,sha256=-qzGzEDAlokEp9E7WtBtQkXyyfPWTYXlwYpCqVJWmqM,1830
|
19
19
|
cidc_api/shared/rest_utils.py,sha256=RwR30WOUAYCxL7V-i2totEyeriG30GbBDvBcpLXhM9w,6594
|
20
|
-
nci_cidc_api_modules-1.2.
|
21
|
-
nci_cidc_api_modules-1.2.
|
22
|
-
nci_cidc_api_modules-1.2.
|
23
|
-
nci_cidc_api_modules-1.2.
|
24
|
-
nci_cidc_api_modules-1.2.
|
20
|
+
nci_cidc_api_modules-1.2.8.dist-info/licenses/LICENSE,sha256=pNYWVTHaYonnmJyplmeAp7tQAjosmDpAWjb34jjv7Xs,1102
|
21
|
+
nci_cidc_api_modules-1.2.8.dist-info/METADATA,sha256=AZJg2SGHrtzfm5wNtIBAzSfqRyrJdPGwRtmFKEoWxTY,39538
|
22
|
+
nci_cidc_api_modules-1.2.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
23
|
+
nci_cidc_api_modules-1.2.8.dist-info/top_level.txt,sha256=rNiRzL0lJGi5Q9tY9uSoMdTbJ-7u5c_D2E86KA94yRA,9
|
24
|
+
nci_cidc_api_modules-1.2.8.dist-info/RECORD,,
|
File without changes
|
{nci_cidc_api_modules-1.2.6.dist-info → nci_cidc_api_modules-1.2.8.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|