awswrangler/athena/_read.py
def _resolve_query_with_cache(
    cache_info: _CacheInfo,
    categories: Optional[List[str]],
    chunksize: Optional[Union[int, bool]],
    use_threads: Union[bool, int],
    session: Optional[boto3.Session],
    s3_additional_kwargs: Optional[Dict[str, Any]],
    pyarrow_additional_kwargs: Optional[Dict[str, Any]] = None,
) -> Union[pd.DataFrame, Iterator[pd.DataFrame]]:
    """Fetch cached data and return it as a pandas DataFrame (or list of DataFrames)."""
    _logger.debug("cache_info:\n%s", cache_info)
    if cache_info.query_execution_id is None:
        raise RuntimeError("Trying to resolve with cache but w/o any query execution ID.")
    query_metadata: _QueryMetadata = _get_query_metadata(
        query_execution_id=cache_info.query_execution_id,
        boto3_session=session,
        categories=categories,
        query_execution_payload=cache_info.query_execution_payload,
        metadata_cache_manager=_cache_manager,
    )
    if cache_info.file_format == "parquet":
        return _fetch_parquet_result(
            query_metadata=query_metadata,
            keep_files=True,
            categories=categories,
            chunksize=chunksize,
            use_threads=use_threads,
            boto3_session=session,
            s3_additional_kwargs=s3_additional_kwargs,
            pyarrow_additional_kwargs=pyarrow_additional_kwargs,
        )
    if cache_info.file_format == "csv":
        return _fetch_csv_result(
            query_metadata=query_metadata,
            keep_files=True,
            chunksize=chunksize,
            use_threads=use_threads,
            boto3_session=session,
            s3_additional_kwargs=s3_additional_kwargs,
        )
    raise exceptions.InvalidArgumentValue(f"Invalid data type: {cache_info.file_format}.")
Fetch cached data and return it as a pandas DataFrame (or list of DataFrames).
Fetch cached data and return it as a pandas DataFrame (or list of DataFrames).
Fetch cached data and return it as a pandas DataFrame ( or list of DataFrames ) .
def _resolve_query_with_cache(
    cache_info: _CacheInfo,
    categories: Optional[List[str]],
    chunksize: Optional[Union[int, bool]],
    use_threads: Union[bool, int],
    session: Optional[boto3.Session],
    s3_additional_kwargs: Optional[Dict[str, Any]],
    pyarrow_additional_kwargs: Optional[Dict[str, Any]] = None,
) -> Union[pd.DataFrame, Iterator[pd.DataFrame]]:
    _logger.debug("cache_info:\n%s", cache_info)
    if cache_info.query_execution_id is None:
        raise RuntimeError("Trying to resolve with cache but w/o any query execution ID.")
    query_metadata: _QueryMetadata = _get_query_metadata(
        query_execution_id=cache_info.query_execution_id,
        boto3_session=session,
        categories=categories,
        query_execution_payload=cache_info.query_execution_payload,
        metadata_cache_manager=_cache_manager,
    )
    if cache_info.file_format == "parquet":
        return _fetch_parquet_result(
            query_metadata=query_metadata,
            keep_files=True,
            categories=categories,
            chunksize=chunksize,
            use_threads=use_threads,
            boto3_session=session,
            s3_additional_kwargs=s3_additional_kwargs,
            pyarrow_additional_kwargs=pyarrow_additional_kwargs,
        )
    if cache_info.file_format == "csv":
        return _fetch_csv_result(
            query_metadata=query_metadata,
            keep_files=True,
            chunksize=chunksize,
            use_threads=use_threads,
            boto3_session=session,
            s3_additional_kwargs=s3_additional_kwargs,
        )
    raise exceptions.InvalidArgumentValue(f"Invalid data type: {cache_info.file_format}.")
def _resolve_query_with_cache ( cache_info : _CacheInfo , categories : Optional [ List [ str ] ] , chunksize : Optional [ Union [ int , bool ] ] , use_threads : Union [ bool , int ] , session : Optional [ boto3 . Session ] , s3_additional_kwargs : Optional [ Dict [ str , Any ] ] , pyarrow_additional_kwargs : Optional [ Dict [ str , Any ] ] = None , ) -> Union [ pd . DataFrame , Iterator [ pd . DataFrame ] ] : _logger . debug ( "cache_info:\n%s" , cache_info ) if cache_info . query_execution_id is None : raise RuntimeError ( "Trying to resolve with cache but w/o any query execution ID." ) query_metadata : _QueryMetadata = _get_query_metadata ( query_execution_id = cache_info . query_execution_id , boto3_session = session , categories = categories , query_execution_payload = cache_info . query_execution_payload , metadata_cache_manager = _cache_manager , ) if cache_info . file_format == "parquet" : return _fetch_parquet_result ( query_metadata = query_metadata , keep_files = True , categories = categories , chunksize = chunksize , use_threads = use_threads , boto3_session = session , s3_additional_kwargs = s3_additional_kwargs , pyarrow_additional_kwargs = pyarrow_additional_kwargs , ) if cache_info . file_format == "csv" : return _fetch_csv_result ( query_metadata = query_metadata , keep_files = True , chunksize = chunksize , use_threads = use_threads , boto3_session = session , s3_additional_kwargs = s3_additional_kwargs , ) raise exceptions . InvalidArgumentValue ( f"Invalid data type: {cache_info.file_format}." )
Fetch cached data and return it as a pandas DataFrame (or list of DataFrames).
Fetch cached data and return it as a pandas DataFrame ( or list of DataFrames ) .
"""Fetch cached data and return it as a pandas DataFrame (or list of DataFrames)."""
cache_info
_CacheInfo
categories
Optional[List[str]]
chunksize
Optional[Union[int, bool]]
use_threads
Union[bool, int]
session
Optional[boto3.Session]
s3_additional_kwargs
Optional[Dict[str, Any]]
pyarrow_additional_kwargs
Optional[Dict[str, Any]]