@@ -328,6 +328,7 @@ def _resolve_query_with_cache(
328328def _resolve_query_without_cache_ctas (
329329 sql : str ,
330330 database : Optional [str ],
331+ data_source : Optional [str ],
331332 s3_output : Optional [str ],
332333 keep_files : bool ,
333334 chunksize : Union [int , bool , None ],
@@ -357,6 +358,7 @@ def _resolve_query_without_cache_ctas(
357358 sql = sql ,
358359 wg_config = wg_config ,
359360 database = database ,
361+ data_source = data_source ,
360362 s3_output = s3_output ,
361363 workgroup = workgroup ,
362364 encryption = encryption ,
@@ -408,6 +410,7 @@ def _resolve_query_without_cache_ctas(
408410def _resolve_query_without_cache_regular (
409411 sql : str ,
410412 database : Optional [str ],
413+ data_source : Optional [str ],
411414 s3_output : Optional [str ],
412415 keep_files : bool ,
413416 chunksize : Union [int , bool , None ],
@@ -424,6 +427,7 @@ def _resolve_query_without_cache_regular(
424427 sql = sql ,
425428 wg_config = wg_config ,
426429 database = database ,
430+ data_source = data_source ,
427431 s3_output = s3_output ,
428432 workgroup = workgroup ,
429433 encryption = encryption ,
@@ -447,6 +451,7 @@ def _resolve_query_without_cache(
447451 # pylint: disable=too-many-branches,too-many-locals,too-many-return-statements,too-many-statements
448452 sql : str ,
449453 database : str ,
454+ data_source : Optional [str ],
450455 ctas_approach : bool ,
451456 categories : Optional [List [str ]],
452457 chunksize : Union [int , bool , None ],
@@ -476,6 +481,7 @@ def _resolve_query_without_cache(
476481 return _resolve_query_without_cache_ctas (
477482 sql = sql ,
478483 database = database ,
484+ data_source = data_source ,
479485 s3_output = _s3_output ,
480486 keep_files = keep_files ,
481487 chunksize = chunksize ,
@@ -493,6 +499,7 @@ def _resolve_query_without_cache(
493499 return _resolve_query_without_cache_regular (
494500 sql = sql ,
495501 database = database ,
502+ data_source = data_source ,
496503 s3_output = _s3_output ,
497504 keep_files = keep_files ,
498505 chunksize = chunksize ,
@@ -523,6 +530,7 @@ def read_sql_query(
523530 boto3_session : Optional [boto3 .Session ] = None ,
524531 max_cache_seconds : int = 0 ,
525532 max_cache_query_inspections : int = 50 ,
533+ data_source : Optional [str ] = None ,
526534) -> Union [pd .DataFrame , Iterator [pd .DataFrame ]]:
527535 """Execute any SQL query on AWS Athena and return the results as a Pandas DataFrame.
528536
@@ -662,6 +670,8 @@ def read_sql_query(
662670 Max number of queries that will be inspected from the history to try to find some result to reuse.
663671 The bigger the number of inspection, the bigger will be the latency for not cached queries.
664672 Only takes effect if max_cache_seconds > 0.
673+ data_source : str, optional
674+ Data Source / Catalog name. If None, 'AwsDataCatalog' will be used by default.
665675
666676 Returns
667677 -------
@@ -701,6 +711,7 @@ def read_sql_query(
701711 return _resolve_query_without_cache (
702712 sql = sql ,
703713 database = database ,
714+ data_source = data_source ,
704715 ctas_approach = ctas_approach ,
705716 categories = categories ,
706717 chunksize = chunksize ,
@@ -732,6 +743,7 @@ def read_sql_table(
732743 boto3_session : Optional [boto3 .Session ] = None ,
733744 max_cache_seconds : int = 0 ,
734745 max_cache_query_inspections : int = 50 ,
746+ data_source : Optional [str ] = None ,
735747) -> Union [pd .DataFrame , Iterator [pd .DataFrame ]]:
736748 """Extract the full table AWS Athena and return the results as a Pandas DataFrame.
737749
@@ -868,6 +880,8 @@ def read_sql_table(
868880 Max number of queries that will be inspected from the history to try to find some result to reuse.
869881 The bigger the number of inspection, the bigger will be the latency for not cached queries.
870882 Only takes effect if max_cache_seconds > 0.
883+ data_source : str, optional
884+ Data Source / Catalog name. If None, 'AwsDataCatalog' will be used by default.
871885
872886 Returns
873887 -------
@@ -885,6 +899,7 @@ def read_sql_table(
885899 return read_sql_query (
886900 sql = f'SELECT * FROM "{ table } "' ,
887901 database = database ,
902+ data_source = data_source ,
888903 ctas_approach = ctas_approach ,
889904 categories = categories ,
890905 chunksize = chunksize ,
0 commit comments