class_docstr: SQL connectors are used to connect to SQL databases in different dialects.
class_docstr_tok: ["SQL","connectors","are","used","to","connect","to","SQL","databases","in","different","dialects","."]
docstr: Return the cached data if it exists and is not older than the cache interval.
  
  Args:
      include_additional_filters (bool, optional): Whether to include the
          additional filters in when calling `_get_column_hash()`.
          Defaults to False.
  
  Returns:
      DataFrame|bool: The name of the file containing cached data if it exists
          and is not older than the cache interval, False otherwise.
docstr_tok: ["Return","the","cached","data","if","it","exists","and","is","not","older","than","the","cache","interval",".","Args",":","include_additional_filters","(","bool",",","optional",")",":","Whether","to","include","the","additional","filters","in","when","calling","`","_get_column_hash","(",")","`",".","Defaults","to","False",".","Returns",":","DataFrame|bool",":","The","name","of","the","file","containing","cached","data","if","it","exists","and","is","not","older","than","the","cache","interval",",","False","otherwise","."]
code: def _cached(
      self, include_additional_filters: bool = False
  ) -> Union[str, bool]:
      """
      Return the cached data if it exists and is not older than the cache interval.
  
      Args:
          include_additional_filters (bool, optional): Whether to include the
              additional filters in when calling `_get_column_hash()`.
              Defaults to False.
  
      Returns:
          DataFrame|bool: The name of the file containing cached data if it exists
              and is not older than the cache interval, False otherwise.
      """
      filename = self._get_cache_path(
          include_additional_filters=include_additional_filters
      )
      if not os.path.exists(filename):
          return False
  
      # If the file is older than 1 day, delete it
      if (
          os.path.getmtime(filename)
          < time.time() - self._cache_interval
      ):
          if self.logger:
              self.logger.log(
                  f"Deleting expired cached data from {filename}"
              )
          os.remove(filename)
          return False
  
      if self.logger:
          self.logger.log(f"Loading cached data from {filename}")
  
      return filename
  
imports: import re
  import os
  import pandas
  from pandasai.exceptions import MaliciousQueryError
  from .base import BaseConnector, SQLConnectorConfig, SqliteConnectorConfig
  from .base import BaseConnectorConfig
  from sqlalchemy import create_engine, text, select, asc
  from sqlalchemy.engine import Connection
  from functools import cached_property, cache
  import hashlib
  from ..helpers.path import find_project_root
  from ..constants import DEFAULT_FILE_PERMISSIONS
  from typing import Union
  import time
label_desc: Use image node_id 10 for calling the SQLConnector obj's underlying member method code with example usage: obj._cached(include_additional_filters) and returns: filename, False, False