6767 T = TypeVar ('T' )
6868
6969from .. import errors , os_utils
70- from ..compat import as_text
70+ from ..compat import as_str
7171from ..vertica import messages
7272from ..vertica .column import Column
7373from ..vertica .deserializer import Deserializer
@@ -217,7 +217,7 @@ def execute(self, operation: str,
217217
218218 self .flush_to_query_ready ()
219219
220- operation = as_text (operation )
220+ operation = as_str (operation )
221221 self .operation = operation
222222
223223 self .rowcount = - 1
@@ -281,7 +281,7 @@ def executemany(self,
281281
282282 self .flush_to_query_ready ()
283283
284- operation = as_text (operation )
284+ operation = as_str (operation )
285285 self .operation = operation
286286
287287 use_prepared = bool (self .connection .options ['use_prepared_statements' ]
@@ -308,12 +308,12 @@ def executemany(self,
308308 #################################################################
309309 m = self ._insert_statement .match (operation )
310310 if m :
311- target = as_text (m .group ('target' ))
311+ target = as_str (m .group ('target' ))
312312
313- variables = as_text (m .group ('variables' ))
313+ variables = as_str (m .group ('variables' ))
314314 variables = "," .join ([variable .strip ().strip ('"' ) for variable in variables .split ("," )])
315315
316- values = as_text (m .group ('values' ))
316+ values = as_str (m .group ('values' ))
317317 values = "|" .join ([value .strip ().strip ('"' ) for value in values .split ("," )])
318318 seq_of_values = [self .format_operation_with_parameters (values , parameters , is_copy_data = True )
319319 for parameters in seq_of_parameters ]
@@ -474,7 +474,7 @@ def copy(self, sql: str, data: Union[IO[AnyStr], bytes, str], **kwargs: Any) ->
474474 >> fs, buffer_size=65536)
475475 ```
476476 """
477- sql = as_text (sql )
477+ sql = as_str (sql )
478478 self .operation = sql
479479
480480 if self .closed ():
@@ -647,14 +647,14 @@ def object_to_string(self, py_obj: Any, is_copy_data: bool, is_collection: bool
647647 if not isinstance (result , (str , bytes )):
648648 raise TypeError ("Unexpected return type of {} adapter: {}, expected a string type."
649649 .format (type (py_obj ), type (result )))
650- return as_text (result )
650+ return as_str (result )
651651
652652 if isinstance (py_obj , type (None )):
653653 return '' if is_copy_data and not is_collection else 'NULL'
654654 elif isinstance (py_obj , bool ):
655655 return str (py_obj )
656656 elif isinstance (py_obj , (str , bytes )):
657- return self .format_quote (as_text (py_obj ), is_copy_data , is_collection )
657+ return self .format_quote (as_str (py_obj ), is_copy_data , is_collection )
658658 elif isinstance (py_obj , (int , Decimal )):
659659 return str (py_obj )
660660 elif isinstance (py_obj , float ):
@@ -700,7 +700,7 @@ def object_to_string(self, py_obj: Any, is_copy_data: bool, is_collection: bool
700700 # Use the ROW keyword to construct a row value
701701 return f'ROW({ "," .join (elements )} )'
702702 elif isinstance (py_obj , (datetime .datetime , datetime .date , datetime .time , UUID )):
703- return self .format_quote (as_text ( str (py_obj ) ), is_copy_data , is_collection )
703+ return self .format_quote (str (py_obj ), is_copy_data , is_collection )
704704 else :
705705 if is_copy_data :
706706 return str (py_obj )
@@ -721,7 +721,6 @@ def format_operation_with_parameters(self, operation: str, parameters: Union[Lis
721721 for key , param in parameters .items ():
722722 if not isinstance (key , str ):
723723 key = str (key )
724- key = as_text (key )
725724
726725 value = self .object_to_string (param , is_copy_data )
727726
0 commit comments