cdapython 2.0.11__tar.gz → 2.0.12__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-31: 2.0.12: standardize debug-layer SQL echo; adjust column\_values() to handle known pathologies
2
+
1
3
  2025-10-27: 2.0.11: _cough_ bugfix for previous
2
4
 
3
5
  2025-10-27: 2.0.10: integrate column\_values() parameter validation with shared validation library; expand support for column\_values( data\_source ) to accept list values in addition to single strings
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdapython
3
- Version: 2.0.11
3
+ Version: 2.0.12
4
4
  Summary: NCI CRDC CDA front-end user interface library
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.9,<4.0
@@ -885,6 +885,16 @@ def column_values(
885
885
  # Normalize sort_by case. Also, ':asc' is redundant: remove it (politely).
886
886
  sort_by = re.sub( r':asc$', r'', sort_by ).lower()
887
887
 
888
+ # Set default sort_by value.
889
+ if sort_by == '':
890
+ if return_data_as in [ '', 'dataframe', 'tsv' ]:
891
+ sort_by = 'count'
892
+ elif return_data_as in [ 'list' ]:
893
+ sort_by = 'value'
894
+ else:
895
+ log.error( f"Cannot identify default `sort_by` value for unexpected `return_data_as` value '{return_data_as}': please notify the CDA devs of this event." )
896
+ return
897
+
888
898
  #############################################################################################################################
889
899
  # Check in advance for columns flagged as high-overhead.
890
900
 
@@ -824,13 +824,15 @@ def get_data(
824
824
 
825
825
  next_result_batch = pd.json_normalize( api_response_object.to_dict()['result'] )
826
826
 
827
+ log.debug( f"/data/{table} endpoint query SQL:\n{api_response_object.to_dict()['query_sql']}" )
828
+
827
829
  # Add data from this page to our full result set.
828
830
 
829
831
  if not result_dataframe.empty and not next_result_batch.empty:
830
832
 
831
833
  # Silence a future deprecation warning about pd.concat and empty DataFrame columns.
832
834
  #
833
- # Possiby relevant note: never fill in missing numeric values with 0!
835
+ # Possibly relevant note: never fill in missing numeric values with 0!
834
836
 
835
837
  next_result_batch = next_result_batch.astype( result_dataframe.dtypes )
836
838
  result_dataframe = pd.concat( [result_dataframe, next_result_batch] )
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cdapython"
3
- version = "2.0.11"
3
+ version = "2.0.12"
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