def _delete_rows_by_start_and_end_date(self):
<EOL>if (self.start_date is not None) and (self.end_date is not None):<EOL><INDENT>start_date_ut = self.gtfs.get_day_start_ut(self.start_date)<EOL>end_date_ut = self.gtfs.get_day_start_ut(self.end_date)<EOL>if self.copy_db_conn.execute("<STR_LIT>"<EOL>"<STR_LIT>").fetchone() != (<NUM_LIT:0>,):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>logging.info("<STR_LIT>")<EOL>table_to_preserve_map = {<EOL>"<STR_LIT>": "<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>"<STR_LIT>": '<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>"<STR_LIT>": "<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>}<EOL>table_to_remove_map = {key: "<STR_LIT>" + to_preserve + "<STR_LIT>"<EOL>for key, to_preserve in table_to_preserve_map.items() }<EOL>GTFS(self.copy_db_conn).set_current_process_time_zone()<EOL>for table, query_template in table_to_remove_map.items():<EOL><INDENT>param_dict = {"<STR_LIT>": str(start_date_ut),<EOL>"<STR_LIT>": str(end_date_ut)}<EOL>query = "<STR_LIT>" + table + "<STR_LIT:U+0020>" +query_template.format(**param_dict)<EOL>self.copy_db_conn.execute(query)<EOL>self.copy_db_conn.commit()<EOL><DEDENT>return FILTERED<EOL><DEDENT>else:<EOL><INDENT>return NOT_FILTERED<EOL><DEDENT>
Removes rows from the sqlite database copy that are out of the time span defined by start_date and end_date
:param gtfs: GTFS object
:param copy_db_conn: sqlite database connection
:param start_date:
:param end_date:
:return: