@@ -1907,7 +1907,7 @@ def overwrite_table_parameters(
19071907
19081908def _get_table_input (
19091909 database : str , table : str , boto3_session : Optional [boto3 .Session ], catalog_id : Optional [str ] = None
1910- ) -> Optional [Dict [str , str ]]:
1910+ ) -> Optional [Dict [str , Any ]]:
19111911 client_glue : boto3 .client = _utils .client (service_name = "glue" , session = boto3_session )
19121912 args : Dict [str , str ] = {}
19131913 if catalog_id is not None :
@@ -1918,14 +1918,24 @@ def _get_table_input(
19181918 response : Dict [str , Any ] = client_glue .get_table (** args )
19191919 except client_glue .exceptions .EntityNotFoundException :
19201920 return None
1921- if "DatabaseName" in response ["Table" ]:
1922- del response ["Table" ]["DatabaseName" ]
1923- if "CreateTime" in response ["Table" ]:
1924- del response ["Table" ]["CreateTime" ]
1925- if "UpdateTime" in response ["Table" ]:
1926- del response ["Table" ]["UpdateTime" ]
1927- if "CreatedBy" in response ["Table" ]:
1928- del response ["Table" ]["CreatedBy" ]
1929- if "IsRegisteredWithLakeFormation" in response ["Table" ]:
1930- del response ["Table" ]["IsRegisteredWithLakeFormation" ]
1931- return response ["Table" ]
1921+
1922+ table_input : Dict [str , Any ] = {}
1923+ for k , v in response ["Table" ].items ():
1924+ if k in [
1925+ "Name" ,
1926+ "Description" ,
1927+ "Owner" ,
1928+ "LastAccessTime" ,
1929+ "LastAnalyzedTime" ,
1930+ "Retention" ,
1931+ "StorageDescriptor" ,
1932+ "PartitionKeys" ,
1933+ "ViewOriginalText" ,
1934+ "ViewExpandedText" ,
1935+ "TableType" ,
1936+ "Parameters" ,
1937+ "TargetTable" ,
1938+ ]:
1939+ table_input [k ] = v
1940+
1941+ return table_input
0 commit comments