cdapython 2.0.7__tar.gz → 2.0.9__tar.gz
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.
- {cdapython-2.0.7 → cdapython-2.0.9}/CHANGELOG.md +4 -0
- {cdapython-2.0.7 → cdapython-2.0.9}/PKG-INFO +1 -1
- {cdapython-2.0.7 → cdapython-2.0.9}/cdapython/discover.py +30 -14
- {cdapython-2.0.7 → cdapython-2.0.9}/cdapython/get_data.py +7 -7
- {cdapython-2.0.7 → cdapython-2.0.9}/cdapython/summarize.py +23 -23
- {cdapython-2.0.7 → cdapython-2.0.9}/pyproject.toml +1 -1
- {cdapython-2.0.7 → cdapython-2.0.9}/LICENSE +0 -0
- {cdapython-2.0.7 → cdapython-2.0.9}/README.md +0 -0
- {cdapython-2.0.7 → cdapython-2.0.9}/cdapython/__init__.py +0 -0
- {cdapython-2.0.7 → cdapython-2.0.9}/cdapython/application_utilities.py +0 -0
- {cdapython-2.0.7 → cdapython-2.0.9}/cdapython/config/__init__.py +0 -0
- {cdapython-2.0.7 → cdapython-2.0.9}/cdapython/config/logger_default_config.yml +0 -0
- {cdapython-2.0.7 → cdapython-2.0.9}/cdapython/logging_wrappers.py +0 -0
- {cdapython-2.0.7 → cdapython-2.0.9}/cdapython/validation.py +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
2025-10-22: 2.0.9: parametrize data\_source check in column\_values()
|
|
2
|
+
|
|
3
|
+
2025-10-20: 2.0.8: rename CDS to GC throughout
|
|
4
|
+
|
|
1
5
|
2025-10-08: 2.0.7: fix malformed column metadata selector inside `collate=True` provenance management in get\_data()
|
|
2
6
|
|
|
3
7
|
2025-09-17: 2.0.6: update ternary numeric comparison handling for latest API ternary operator syntax support
|
|
@@ -788,7 +788,7 @@ def column_values(
|
|
|
788
788
|
|
|
789
789
|
data_source ( string; optional ):
|
|
790
790
|
Restrict returned values to the given upstream data source. Current
|
|
791
|
-
valid values are '
|
|
791
|
+
valid values are 'GC', 'GDC', 'PDC', 'IDC' and 'ICDC'.
|
|
792
792
|
Defaults to '' (no filter).
|
|
793
793
|
|
|
794
794
|
force( boolean; optional ):
|
|
@@ -834,20 +834,36 @@ def column_values(
|
|
|
834
834
|
# Let's not care about case, and remove any whitespace before it can do any damage.
|
|
835
835
|
data_source = re.sub( r'\s+', r'', data_source ).upper()
|
|
836
836
|
|
|
837
|
-
#
|
|
838
|
-
#
|
|
839
|
-
#
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
837
|
+
# Cache valid labels for upstream data sources. The data structure coming back from
|
|
838
|
+
# release_metadata() is a list of dicts, with each dict looking like
|
|
839
|
+
#
|
|
840
|
+
# {
|
|
841
|
+
# 'cda_table': 'file',
|
|
842
|
+
# 'cda_column': 'access',
|
|
843
|
+
# 'data_source': 'GDC',
|
|
844
|
+
# 'data_source_version': 'March 2025',
|
|
845
|
+
# 'data_source_extraction_date': '2025-03-21',
|
|
846
|
+
# 'data_source_row_count': 3025352,
|
|
847
|
+
# 'data_source_unique_value_count': 4,
|
|
848
|
+
# 'data_source_null_count': 407714
|
|
849
|
+
# }
|
|
850
|
+
|
|
851
|
+
try:
|
|
852
|
+
cached_release_metadata = release_metadata()
|
|
853
|
+
except Exception as e:
|
|
854
|
+
log.critical( e )
|
|
855
|
+
return
|
|
856
|
+
|
|
857
|
+
valid_data_sources = set()
|
|
858
|
+
|
|
859
|
+
for column_record in cached_release_metadata:
|
|
860
|
+
record_data_source = column_record['data_source']
|
|
861
|
+
# Let's not care about case.
|
|
862
|
+
if record_data_source.upper() != 'CDA':
|
|
863
|
+
valid_data_sources.add( record_data_source.upper() )
|
|
848
864
|
|
|
849
|
-
if data_source != '' and data_source not in
|
|
850
|
-
log.error( f"The 'data_source' parameter must be one of
|
|
865
|
+
if data_source != '' and data_source not in valid_data_sources:
|
|
866
|
+
log.error( f"The 'data_source' parameter must be one of { sorted( valid_data_sources ) }. You supplied '{data_source}', which is not." )
|
|
851
867
|
return
|
|
852
868
|
|
|
853
869
|
#############################################################################################################################
|
|
@@ -68,8 +68,8 @@ def get_file_data(
|
|
|
68
68
|
|
|
69
69
|
data_source ( string or list of strings; optional ):
|
|
70
70
|
Restrict results to those deriving from the given upstream
|
|
71
|
-
data source(s). Current valid values are '
|
|
72
|
-
'
|
|
71
|
+
data source(s). Current valid values are 'GC', 'GDC', 'IDC',
|
|
72
|
+
'PDC' and 'ICDC'. (Default: no filter.)
|
|
73
73
|
|
|
74
74
|
add_columns ( string or list of strings; optional ):
|
|
75
75
|
One or more columns from a second table to add to result data.
|
|
@@ -185,8 +185,8 @@ def get_subject_data(
|
|
|
185
185
|
|
|
186
186
|
data_source ( string or list of strings; optional ):
|
|
187
187
|
Restrict results to those deriving from the given upstream
|
|
188
|
-
data source(s). Current valid values are '
|
|
189
|
-
'
|
|
188
|
+
data source(s). Current valid values are 'GC', 'GDC', 'IDC',
|
|
189
|
+
'PDC' and 'ICDC'. (Default: no filter.)
|
|
190
190
|
|
|
191
191
|
add_columns ( string or list of strings; optional ):
|
|
192
192
|
One or more columns from a second table to add to result data.
|
|
@@ -311,8 +311,8 @@ def get_data(
|
|
|
311
311
|
|
|
312
312
|
data_source ( string or list of strings; optional ):
|
|
313
313
|
Restrict results to those deriving from the given upstream
|
|
314
|
-
data source(s). Current valid values are '
|
|
315
|
-
'
|
|
314
|
+
data source(s). Current valid values are 'GC', 'GDC', 'IDC',
|
|
315
|
+
'PDC' and 'ICDC'. (Default: no filter.)
|
|
316
316
|
|
|
317
317
|
add_columns ( string or list of strings; optional ):
|
|
318
318
|
One or more columns from a second table to add to result data from `table`.
|
|
@@ -759,7 +759,7 @@ def get_data(
|
|
|
759
759
|
# "ethnicity": null,
|
|
760
760
|
# "subject_data_at_gdc": true,
|
|
761
761
|
# "subject_data_at_idc": true,
|
|
762
|
-
# "
|
|
762
|
+
# "subject_data_at_gc": false,
|
|
763
763
|
# "subject_data_at_pdc": true,
|
|
764
764
|
# "subject_data_at_icdc": false,
|
|
765
765
|
# "subject_data_source_count": 3,
|
|
@@ -544,8 +544,8 @@ def summarize_files(
|
|
|
544
544
|
|
|
545
545
|
data_source ( string or list of strings; optional ):
|
|
546
546
|
Restrict results to those deriving from the given upstream
|
|
547
|
-
data source(s). Current valid values are '
|
|
548
|
-
'
|
|
547
|
+
data source(s). Current valid values are 'GC', 'GDC', 'IDC',
|
|
548
|
+
'PDC' and 'ICDC'. (Default: no filter.)
|
|
549
549
|
|
|
550
550
|
add_columns ( string or list of strings; optional ):
|
|
551
551
|
One or more columns from a second table to add to summary output.
|
|
@@ -686,8 +686,8 @@ def summarize_subjects(
|
|
|
686
686
|
|
|
687
687
|
data_source ( string or list of strings; optional ):
|
|
688
688
|
Restrict results to those deriving from the given upstream
|
|
689
|
-
data source(s). Current valid values are '
|
|
690
|
-
'
|
|
689
|
+
data source(s). Current valid values are 'GC', 'GDC', 'IDC',
|
|
690
|
+
'PDC' and 'ICDC'. (Default: no filter.)
|
|
691
691
|
|
|
692
692
|
add_columns ( string or list of strings; optional ):
|
|
693
693
|
One or more columns from a second table to add to summary output.
|
|
@@ -832,8 +832,8 @@ def summarize(
|
|
|
832
832
|
|
|
833
833
|
data_source ( string or list of strings; optional ):
|
|
834
834
|
Restrict results to those deriving from the given upstream
|
|
835
|
-
data source(s). Current valid values are '
|
|
836
|
-
'
|
|
835
|
+
data source(s). Current valid values are 'GC', 'GDC', 'IDC',
|
|
836
|
+
'PDC' and 'ICDC'. (Default: no filter.)
|
|
837
837
|
|
|
838
838
|
add_columns ( string or list of strings; optional ):
|
|
839
839
|
One or more columns from a second table to add to summary output for `table`.
|
|
@@ -1338,37 +1338,37 @@ def summarize(
|
|
|
1338
1338
|
# }
|
|
1339
1339
|
# ],
|
|
1340
1340
|
# "data_source": {
|
|
1341
|
-
# "
|
|
1341
|
+
# "gc_exclusive": 235,
|
|
1342
1342
|
# "gdc_exclusive": 351,
|
|
1343
1343
|
# "icdc_exclusive": 0,
|
|
1344
1344
|
# "idc_exclusive": 0,
|
|
1345
1345
|
# "pdc_exclusive": 6,
|
|
1346
|
-
# "
|
|
1347
|
-
# "
|
|
1348
|
-
# "
|
|
1349
|
-
# "
|
|
1346
|
+
# "gc_gdc_exclusive": 0,
|
|
1347
|
+
# "gc_icdc_exclusive": 0,
|
|
1348
|
+
# "gc_idc_exclusive": 898,
|
|
1349
|
+
# "gc_pdc_exclusive": 0,
|
|
1350
1350
|
# "gdc_icdc_exclusive": 0,
|
|
1351
1351
|
# "gdc_idc_exclusive": 4544,
|
|
1352
1352
|
# "gdc_pdc_exclusive": 7,
|
|
1353
1353
|
# "icdc_idc_exclusive": 0,
|
|
1354
1354
|
# "icdc_pdc_exclusive": 0,
|
|
1355
1355
|
# "idc_pdc_exclusive": 0,
|
|
1356
|
-
# "
|
|
1357
|
-
# "
|
|
1358
|
-
# "
|
|
1359
|
-
# "
|
|
1360
|
-
# "
|
|
1361
|
-
# "
|
|
1356
|
+
# "gc_gdc_icdc_exclusive": 0,
|
|
1357
|
+
# "gc_gdc_idc_exclusive": 574,
|
|
1358
|
+
# "gc_gdc_pdc_exclusive": 1,
|
|
1359
|
+
# "gc_icdc_idc_exclusive": 0,
|
|
1360
|
+
# "gc_icdc_pdc_exclusive": 0,
|
|
1361
|
+
# "gc_idc_pdc_exclusive": 0,
|
|
1362
1362
|
# "gdc_icdc_idc_exclusive": 0,
|
|
1363
1363
|
# "gdc_icdc_pdc_exclusive": 0,
|
|
1364
1364
|
# "gdc_idc_pdc_exclusive": 205,
|
|
1365
1365
|
# "icdc_idc_pdc_exclusive": 0,
|
|
1366
|
-
# "
|
|
1367
|
-
# "
|
|
1368
|
-
# "
|
|
1369
|
-
# "
|
|
1366
|
+
# "gc_gdc_icdc_idc_exclusive": 0,
|
|
1367
|
+
# "gc_gdc_icdc_pdc_exclusive": 0,
|
|
1368
|
+
# "gc_gdc_idc_pdc_exclusive": 83,
|
|
1369
|
+
# "gc_icdc_idc_pdc_exclusive": 0,
|
|
1370
1370
|
# "gdc_icdc_idc_pdc_exclusive": 0,
|
|
1371
|
-
# "
|
|
1371
|
+
# "gc_gdc_icdc_idc_pdc": 0
|
|
1372
1372
|
# },
|
|
1373
1373
|
# "sex": [
|
|
1374
1374
|
# {
|
|
@@ -1386,7 +1386,7 @@ def summarize(
|
|
|
1386
1386
|
# ]
|
|
1387
1387
|
# }
|
|
1388
1388
|
# ],
|
|
1389
|
-
# "query_sql": "WITH subject_preselect AS (SELECT subject.id AS subject_id, subject.id_alias AS subject_id_alias, [...these are very long!...] AS
|
|
1389
|
+
# "query_sql": "WITH subject_preselect AS (SELECT subject.id AS subject_id, subject.id_alias AS subject_id_alias, [...these are very long!...] AS gc_gdc_icdc_idc_pdc) AS subquery) AS data_source, (SELECT observation_columns.sex FROM observation_columns) AS sex) AS json_result"
|
|
1390
1390
|
# }
|
|
1391
1391
|
|
|
1392
1392
|
# Report some metadata about the results we got back.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|