26
26
from danswer .connectors .models import ConnectorMissingCredentialError
27
27
from danswer .connectors .models import Document
28
28
from danswer .connectors .models import Section
29
- from danswer .file_processing .extract_file_text import check_file_ext_is_valid
30
29
from danswer .file_processing .extract_file_text import detect_encoding
31
30
from danswer .file_processing .extract_file_text import extract_file_text
32
31
from danswer .file_processing .extract_file_text import get_file_ext
33
32
from danswer .file_processing .extract_file_text import is_text_file_extension
33
+ from danswer .file_processing .extract_file_text import is_valid_file_ext
34
34
from danswer .file_processing .extract_file_text import read_text_file
35
35
from danswer .utils .logger import setup_logger
36
36
@@ -99,7 +99,7 @@ def _process_egnyte_file(
99
99
100
100
file_name = file_metadata ["name" ]
101
101
extension = get_file_ext (file_name )
102
- if not check_file_ext_is_valid (extension ):
102
+ if not is_valid_file_ext (extension ):
103
103
logger .warning (f"Skipping file '{ file_name } ' with extension '{ extension } '" )
104
104
return None
105
105
@@ -170,7 +170,7 @@ def oauth_id(cls) -> DocumentSource:
170
170
return DocumentSource .EGNYTE
171
171
172
172
@classmethod
173
- def redirect_uri (cls , base_domain : str , state : str ) -> str :
173
+ def oauth_authorization_url (cls , base_domain : str , state : str ) -> str :
174
174
if not EGNYTE_CLIENT_ID :
175
175
raise ValueError ("EGNYTE_CLIENT_ID environment variable must be set" )
176
176
if not EGNYTE_BASE_DOMAIN :
@@ -190,7 +190,7 @@ def redirect_uri(cls, base_domain: str, state: str) -> str:
190
190
)
191
191
192
192
@classmethod
193
- def code_to_token (cls , code : str ) -> dict [str , Any ]:
193
+ def oauth_code_to_token (cls , code : str ) -> dict [str , Any ]:
194
194
if not EGNYTE_CLIENT_ID :
195
195
raise ValueError ("EGNYTE_CLIENT_ID environment variable must be set" )
196
196
if not EGNYTE_CLIENT_SECRET :
@@ -342,8 +342,8 @@ def _process_files(
342
342
yield current_batch
343
343
current_batch = []
344
344
345
- except Exception as e :
346
- logger .error (f"Failed to process file { file ['path' ]} : { str ( e ) } " )
345
+ except Exception :
346
+ logger .exception (f"Failed to process file { file ['path' ]} " )
347
347
continue
348
348
349
349
if current_batch :
0 commit comments