cdapython 2.0.6__tar.gz → 2.0.7__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.
@@ -1,3 +1,5 @@
1
+ 2025-10-08: 2.0.7: fix malformed column metadata selector inside `collate=True` provenance management in get\_data()
2
+
1
3
  2025-09-17: 2.0.6: update ternary numeric comparison handling for latest API ternary operator syntax support
2
4
 
3
5
  2025-08-18: 2.0.2: update PyYAML build dependency
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdapython
3
- Version: 2.0.6
3
+ Version: 2.0.7
4
4
  Summary: NCI CRDC CDA front-end user interface library
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.9,<4.0
@@ -609,7 +609,7 @@ def get_data(
609
609
  # Ignore requests for columns that are already present by default, and don't add columns twice.
610
610
  if column_to_add not in source_table_columns_in_order and column_to_add not in columns_to_add:
611
611
  # If collate == True, we'll need to ask for provenance information from this column's
612
- # home table, if we haven't yet done so.
612
+ # home table, if we haven't yet done so. This info is returned by default only for `file` and `subject`.
613
613
  if collate_results:
614
614
  # Identify this column's home table.
615
615
  foreign_table_name = ''
@@ -629,7 +629,8 @@ def get_data(
629
629
 
630
630
  if collate_results:
631
631
  # Be sure to include requests for provenance information about foreign tables
632
- # included only implicitly (by filters, not by add_columns).
632
+ # included only implicitly (by filters, not by add_columns). Such info is
633
+ # only included by default from `file` and `subject`.
633
634
 
634
635
  for filter_query in set( queries_for_match_all ) | set( queries_for_match_any ):
635
636
  # TO DO: Compartmentalize/parametrize this conditional check better: it repeats much that is already made explicit in validation.py.
@@ -648,13 +649,17 @@ def get_data(
648
649
  column_to_add = column_name
649
650
  if not filter_is_ternary:
650
651
  column_to_add = re.search( r'^(\S+)\s', filter_query ).group(1)
651
- foreign_table_name = cached_column_metadata.query( f"column == '{column_to_add}'" )['table'].iloc[0]
652
- # Check to see if we're already asking for provenance info from that table: if not, do, unless {table} is 'upstream_identifiers'.
653
- if foreign_table_name != 'upstream_identifiers':
654
- for data_source in [ source_label.lower() for source_label in sorted( valid_data_sources ) ]:
655
- provenance_field = f"{foreign_table_name}_data_at_{data_source}"
656
- if provenance_field not in columns_to_add:
657
- columns_to_add.append( provenance_field )
652
+ # The user-exposed `data_source` parameter can add filters on e.g. `subject_data_at_pdc` -- don't bother with these.
653
+ # They won't be in the reference structure we're about to search, and they don't on their own indicate
654
+ # a need for any extra provenance info.
655
+ if re.search( r'_data_at_', column_to_add ) is None:
656
+ foreign_table_name = cached_column_metadata.query( f"column == '{column_to_add}'" )['table'].iloc[0]
657
+ # Check to see if we're already asking for provenance info from that table: if not, do, unless {table} is 'upstream_identifiers'.
658
+ if foreign_table_name != 'upstream_identifiers':
659
+ for data_source in [ source_label.lower() for source_label in sorted( valid_data_sources ) ]:
660
+ provenance_field = f"{foreign_table_name}_data_at_{data_source}"
661
+ if provenance_field not in columns_to_add:
662
+ columns_to_add.append( provenance_field )
658
663
 
659
664
  columns_to_exclude = list()
660
665
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cdapython"
3
- version = "2.0.6"
3
+ version = "2.0.7"
4
4
  description = "NCI CRDC CDA front-end user interface library"
5
5
  authors = []
6
6
  readme = "README.md"
File without changes
File without changes