@@ -561,17 +561,18 @@ def run_paging_demo(label: str, *, top: Optional[int], page_size: Optional[int])
561561 created_details = column_create
562562 if not all (isinstance (item , str ) for item in created_details ):
563563 raise RuntimeError ("create_column entries were not schema strings" )
564- attribute_schema = created_details [ 0 ]
564+ # create_columns returns logical names
565565 odata_client = client ._get_odata ()
566+ column_logical = created_details [0 ]
566567 exists_after_create = None
567568 exists_after_delete = None
568569 attr_type_before = None
569- if metadata_id and attribute_schema :
570+ if metadata_id and column_logical :
570571 _ready_message = "Column metadata not yet available"
571572 def _metadata_after_create ():
572573 meta = odata_client ._get_attribute_metadata (
573574 metadata_id ,
574- attribute_schema ,
575+ column_logical ,
575576 extra_select = "@odata.type,AttributeType" ,
576577 )
577578 if not meta or not meta .get ("MetadataId" ):
@@ -589,7 +590,8 @@ def _metadata_after_create():
589590 if isinstance (raw_type , str ):
590591 attr_type_before = raw_type
591592 lowered = raw_type .lower ()
592- delete_target = attribute_schema or scratch_column
593+ # For delete, we pass the logical name
594+ delete_target = column_logical
593595 log_call (f"client.delete_column('{ logical } ', '{ delete_target } ')" )
594596
595597 def _delete_column ():
@@ -610,12 +612,14 @@ def _delete_column():
610612 deleted_details = column_delete
611613 if not all (isinstance (item , str ) for item in deleted_details ):
612614 raise RuntimeError ("delete_column entries were not schema strings" )
613- if attribute_schema not in deleted_details :
615+ # deleted_details contains logical names (lowercase), so check for column_logical
616+ if column_logical not in deleted_details :
614617 raise RuntimeError ("delete_column response missing expected schema name" )
615- if metadata_id and attribute_schema :
618+ if metadata_id and column_logical :
616619 _delete_message = "Column metadata still present after delete"
617620 def _ensure_removed ():
618- meta = odata_client ._get_attribute_metadata (metadata_id , attribute_schema )
621+ # _get_attribute_metadata now accepts logical names
622+ meta = odata_client ._get_attribute_metadata (metadata_id , column_logical )
619623 if meta :
620624 raise RuntimeError (_delete_message )
621625 return True
0 commit comments