@@ -532,7 +532,7 @@ def _response_to_table(self, identifier_tuple: Tuple[str, ...], table_response:
532532
533533 def _response_to_staged_table (self , identifier_tuple : Tuple [str , ...], table_response : TableResponse ) -> StagedTable :
534534 return StagedTable (
535- identifier = identifier_tuple if self . name else identifier_tuple ,
535+ identifier = identifier_tuple ,
536536 metadata_location = table_response .metadata_location , # type: ignore
537537 metadata = table_response .metadata ,
538538 io = self ._load_file_io (
@@ -578,7 +578,6 @@ def _create_table(
578578 fresh_partition_spec = assign_fresh_partition_spec_ids (partition_spec , iceberg_schema , fresh_schema )
579579 fresh_sort_order = assign_fresh_sort_order_ids (sort_order , iceberg_schema , fresh_schema )
580580
581- identifier = self ._identifier_to_tuple_without_catalog (identifier )
582581 namespace_and_table = self ._split_identifier_for_path (identifier )
583582 if location :
584583 location = location .rstrip ("/" )
@@ -659,7 +658,6 @@ def register_table(self, identifier: Union[str, Identifier], metadata_location:
659658 Raises:
660659 TableAlreadyExistsError: If the table already exists
661660 """
662- identifier = self ._identifier_to_tuple_without_catalog (identifier )
663661 namespace_and_table = self ._split_identifier_for_path (identifier )
664662 request = RegisterTableRequest (
665663 name = namespace_and_table ["table" ],
@@ -691,25 +689,19 @@ def list_tables(self, namespace: Union[str, Identifier]) -> List[Identifier]:
691689
692690 @retry (** _RETRY_ARGS )
693691 def load_table (self , identifier : Union [str , Identifier ]) -> Table :
694- identifier_tuple = self ._identifier_to_tuple_without_catalog (identifier )
695- response = self ._session .get (
696- self .url (Endpoints .load_table , prefixed = True , ** self ._split_identifier_for_path (identifier_tuple ))
697- )
692+ response = self ._session .get (self .url (Endpoints .load_table , prefixed = True , ** self ._split_identifier_for_path (identifier )))
698693 try :
699694 response .raise_for_status ()
700695 except HTTPError as exc :
701696 self ._handle_non_200_response (exc , {404 : NoSuchTableError })
702697
703698 table_response = TableResponse (** response .json ())
704- return self ._response_to_table (identifier_tuple , table_response )
699+ return self ._response_to_table (self . identifier_to_tuple ( identifier ) , table_response )
705700
706701 @retry (** _RETRY_ARGS )
707702 def drop_table (self , identifier : Union [str , Identifier ], purge_requested : bool = False ) -> None :
708- identifier_tuple = self ._identifier_to_tuple_without_catalog (identifier )
709703 response = self ._session .delete (
710- self .url (
711- Endpoints .drop_table , prefixed = True , purge = purge_requested , ** self ._split_identifier_for_path (identifier_tuple )
712- ),
704+ self .url (Endpoints .drop_table , prefixed = True , purge = purge_requested , ** self ._split_identifier_for_path (identifier )),
713705 )
714706 try :
715707 response .raise_for_status ()
@@ -722,9 +714,8 @@ def purge_table(self, identifier: Union[str, Identifier]) -> None:
722714
723715 @retry (** _RETRY_ARGS )
724716 def rename_table (self , from_identifier : Union [str , Identifier ], to_identifier : Union [str , Identifier ]) -> Table :
725- from_identifier_tuple = self ._identifier_to_tuple_without_catalog (from_identifier )
726717 payload = {
727- "source" : self ._split_identifier_for_json (from_identifier_tuple ),
718+ "source" : self ._split_identifier_for_json (from_identifier ),
728719 "destination" : self ._split_identifier_for_json (to_identifier ),
729720 }
730721 response = self ._session .post (self .url (Endpoints .rename_table ), json = payload )
@@ -899,9 +890,8 @@ def table_exists(self, identifier: Union[str, Identifier]) -> bool:
899890 Returns:
900891 bool: True if the table exists, False otherwise.
901892 """
902- identifier_tuple = self ._identifier_to_tuple_without_catalog (identifier )
903893 response = self ._session .head (
904- self .url (Endpoints .load_table , prefixed = True , ** self ._split_identifier_for_path (identifier_tuple ))
894+ self .url (Endpoints .load_table , prefixed = True , ** self ._split_identifier_for_path (identifier ))
905895 )
906896
907897 if response .status_code == 404 :
@@ -918,11 +908,8 @@ def table_exists(self, identifier: Union[str, Identifier]) -> bool:
918908
919909 @retry (** _RETRY_ARGS )
920910 def drop_view (self , identifier : Union [str ]) -> None :
921- identifier_tuple = self ._identifier_to_tuple_without_catalog (identifier )
922911 response = self ._session .delete (
923- self .url (
924- Endpoints .drop_view , prefixed = True , ** self ._split_identifier_for_path (identifier_tuple , IdentifierKind .VIEW )
925- ),
912+ self .url (Endpoints .drop_view , prefixed = True , ** self ._split_identifier_for_path (identifier , IdentifierKind .VIEW )),
926913 )
927914 try :
928915 response .raise_for_status ()
0 commit comments