class_docstr: Yahoo Finance connector for retrieving stock data.
class_docstr_tok: ["Yahoo","Finance","connector","for","retrieving","stock","data","."]
docstr: Return the cached Yahoo Finance data if it exists and is not older than the
  cache interval.
  
  Returns:
      DataFrame|None: The cached data if it exists and is not older than the cache
      interval, None otherwise.
docstr_tok: ["Return","the","cached","Yahoo","Finance","data","if","it","exists","and","is","not","older","than","the","cache","interval",".","Returns",":","DataFrame|None",":","The","cached","data","if","it","exists","and","is","not","older","than","the","cache","interval",",","None","otherwise","."]
code: def _cached(self):
      """
      Return the cached Yahoo Finance data if it exists and is not older than the
      cache interval.
  
      Returns:
          DataFrame|None: The cached data if it exists and is not older than the cache
          interval, None otherwise.
      """
      cache_path = self._get_cache_path()
      if not os.path.exists(cache_path):
          return None
  
      # If the file is older than 1 day, delete it
      if (
          os.path.getmtime(cache_path)
          < time.time() - self._cache_interval
      ):
          if self.logger:
              self.logger.log(
                  f"Deleting expired cached data from {cache_path}"
              )
          os.remove(cache_path)
          return None
  
      if self.logger:
          self.logger.log(f"Loading cached data from {cache_path}")
  
      return cache_path
  
file_path: pandas-ai/pandasai/connectors/yahoo_finance.py
imports: import os
  import pandas
  from typing import Optional, Union
  from .base import YahooFinanceConnectorConfig, BaseConnector
  import time
  from ..helpers.path import find_project_root
  from ..constants import DEFAULT_FILE_PERMISSIONS
  import hashlib
label_desc: Use image node_id 5 for calling the YahooFinanceConnector obj's underlying member method code with example usage: obj._cached() and returns: cache_path, None, None