def __convert_cell(self, csv_cell_text): ret = None if self.__auto_detect_int: ret = service.detect_int_value(csv_cell_text) if ret is None and self.__auto_detect_float: ret = service.detect_float_value(csv_cell_text) shall_we_ignore_the_conversion = ( (ret in [float('inf'), float('-inf')]) and self.__ignore_infinity) if shall_we_ignore_the_conversion: ret = None if ret is None and self.__auto_detect_datetime: ret = service.detect_date_value(csv_cell_text) if ret is None: ret = csv_cell_text return ret
def __convert_cell(self, csv_cell_text): ret = None if self.__auto_detect_int: ret = service.detect_int_value(csv_cell_text, self.__pep_0515_off) if ret is None and self.__auto_detect_float: ret = service.detect_float_value( csv_cell_text, self.__pep_0515_off, ignore_nan_text=self.__ignore_nan_text, default_float_nan=self.__default_float_nan, ) shall_we_ignore_the_conversion = ( ret in [float("inf"), float("-inf")] ) and self.__ignore_infinity if shall_we_ignore_the_conversion: ret = None if ret is None and self.__auto_detect_datetime: ret = service.detect_date_value(csv_cell_text) if ret is None: ret = csv_cell_text return ret