File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -1768,24 +1768,26 @@ def extract_display_labels(
17681768 return []
17691769
17701770 # Build column -> label mapping (skip self-references)
1771- col_to_label = {}
1771+ columns_to_label = {}
17721772 if label_map :
17731773 for label , cols in label_map .items ():
17741774 for col in cols :
1775- if label != col and col not in col_to_label :
1776- col_to_label [col ] = label
1775+ if label != col and col not in columns_to_label :
1776+ columns_to_label [col ] = label
17771777
17781778 # Build column -> object mapping
1779- col_to_obj = {}
1779+ columns_by_name : dict [ str , Any ] = {}
17801780 if datasource :
1781- for col in datasource .columns :
1782- name = col .get ("column_name" ) if isinstance (col , dict ) else col .column_name
1783- if name :
1784- col_to_obj [name ] = col
1781+ for column in datasource .columns :
1782+ if isinstance (column , dict ):
1783+ if column_name := column .get ("column_name" ):
1784+ columns_by_name [column_name ] = column
1785+ else :
1786+ columns_by_name [column .column_name ] = column
17851787
17861788 return [
1787- col_to_label .get (col )
1788- or (get_column_name (col_to_obj [col ]) if col in col_to_obj else col )
1789+ columns_to_label .get (col )
1790+ or (get_column_name (columns_by_name [col ]) if col in columns_by_name else col )
17891791 for col in colnames
17901792 ]
17911793
You can’t perform that action at this time.
0 commit comments