cdapython 2.0.4__tar.gz → 2.0.6__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,4 +1,4 @@
1
- 2025-09-17: 2.0.4: update ternary numeric comparison handling for latest API ternary operator syntax support
1
+ 2025-09-17: 2.0.6: update ternary numeric comparison handling for latest API ternary operator syntax support
2
2
 
3
3
  2025-08-18: 2.0.2: update PyYAML build dependency
4
4
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdapython
3
- Version: 2.0.4
3
+ Version: 2.0.6
4
4
  Summary: NCI CRDC CDA front-end user interface library
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.9,<4.0
@@ -632,7 +632,22 @@ def get_data(
632
632
  # included only implicitly (by filters, not by add_columns).
633
633
 
634
634
  for filter_query in set( queries_for_match_all ) | set( queries_for_match_any ):
635
- column_to_add = re.search( r'^(\S+)\s', filter_query ).group(1)
635
+ # TO DO: Compartmentalize/parametrize this conditional check better: it repeats much that is already made explicit in validation.py.
636
+ filter_is_ternary = False
637
+ column_to_add = ''
638
+ match_result = re.search( r'^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S.*)$', filter_query )
639
+ if match_result is not None:
640
+ left_numeric = match_result.group(1)
641
+ left_operator = match_result.group(2)
642
+ column_name = match_result.group(3)
643
+ right_operator = match_result.group(4)
644
+ right_numeric = match_result.group(5)
645
+ if re.search( r'^[-+]?\d+(\.\d+)?$', left_numeric ) is not None and re.search( r'^[-+]?\d+(\.\d+)?$', right_numeric ) is not None and \
646
+ left_operator in { '<', '>', '<=', '>=' } and right_operator in { '<', '>', '<=', '>=' }:
647
+ filter_is_ternary = True
648
+ column_to_add = column_name
649
+ if not filter_is_ternary:
650
+ column_to_add = re.search( r'^(\S+)\s', filter_query ).group(1)
636
651
  foreign_table_name = cached_column_metadata.query( f"column == '{column_to_add}'" )['table'].iloc[0]
637
652
  # Check to see if we're already asking for provenance info from that table: if not, do, unless {table} is 'upstream_identifiers'.
638
653
  if foreign_table_name != 'upstream_identifiers':
@@ -192,7 +192,7 @@ def validate_and_transform_match_filter_list( cached_column_metadata, match_stat
192
192
  if re.search( r'^[-+]?\d+(\.\d+)?$', left_numeric ) is not None and re.search( r'^[-+]?\d+(\.\d+)?$', right_numeric ) is not None and \
193
193
  left_operator in comparison_operators and right_operator in comparison_operators:
194
194
  # This is a numeric comparison of the type we seek.
195
- is_ternary = True
195
+ filter_is_ternary = True
196
196
  filter_column_name = column_name.lower()
197
197
 
198
198
  #############################################################################################################################
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cdapython"
3
- version = "2.0.4"
3
+ version = "2.0.6"
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