From 6890daa90c0ee9d66ac9eaebb9afcb194aeadac5 Mon Sep 17 00:00:00 2001 From: Jim Baldwin <14864200+jimwbaldwin@users.noreply.github.com> Date: Tue, 6 Aug 2024 00:28:58 +1000 Subject: [PATCH] community: make AthenaLoader profile_name optional and fix type hint (#24958) - **Description:** This PR makes the AthenaLoader profile_name optional and fixes the type hint which says the type is `str` but it should be `str` or `None` as None is handled in the loader init. This is a minor problem but it just confused me when I was using the Athena Loader to why we had to use a Profile, as I want that for local but not production. - **Issue:** #24957 - **Dependencies:** None. --- .../langchain_community/document_loaders/athena.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/community/langchain_community/document_loaders/athena.py b/libs/community/langchain_community/document_loaders/athena.py index a6316eb0641..3ba31820a67 100644 --- a/libs/community/langchain_community/document_loaders/athena.py +++ b/libs/community/langchain_community/document_loaders/athena.py @@ -35,15 +35,16 @@ class AthenaLoader(BaseLoader): query: str, database: str, s3_output_uri: str, - profile_name: str, + profile_name: Optional[str] = None, metadata_columns: Optional[List[str]] = None, ): """Initialize Athena document loader. Args: query: The query to run in Athena. - database: Athena database - s3_output_uri: Athena output path + database: Athena database. + s3_output_uri: Athena output path. + profile_name: Optional. AWS credential profile, if profiles are being used. metadata_columns: Optional. Columns written to Document `metadata`. """ self.query = query