Small airtable refactor + handle files with uppercase extensions (#3598)

* Small airtable refactor + handle files with uppercase extensions

* Fix mypy
This commit is contained in:
Chris Weaver
2025-01-05 11:27:50 -08:00
committed by GitHub
parent f895e5f7d0
commit 1db778baa8
2 changed files with 70 additions and 47 deletions

View File

@ -67,7 +67,9 @@ def is_text_file_extension(file_name: str) -> bool:
def get_file_ext(file_path_or_name: str | Path) -> str:
_, extension = os.path.splitext(file_path_or_name)
return extension
# standardize all extensions to be lowercase so that checks against
# VALID_FILE_EXTENSIONS and similar will work as intended
return extension.lower()
def is_valid_file_ext(ext: str) -> bool: