Skip to content

Commit 88084ad

Browse files
fix: Add sheet_name=0 to ExcelFile.parse() calls to satisfy MyPy type stubs
- Explicitly specify sheet_name=0 in both Calamine and Openpyxl parse calls - Behavior unchanged: pandas defaults to first sheet (index 0) when no sheet_name provided - Resolves MyPy call-overload and no-any-return errors - ExcelFormat has no sheet selection parameter, so defaulting to first sheet is correct Co-Authored-By: unknown <>
1 parent adfe576 commit 88084ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

airbyte_cdk/sources/file_based/file_types/excel_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def open_and_parse_file(
203203
calamine_exc: Optional[Exception] = None
204204
try:
205205
with pd.ExcelFile(fp, engine="calamine") as excel_file: # type: ignore [arg-type, call-overload]
206-
return excel_file.parse() # type: ignore [no-any-return]
206+
return excel_file.parse(sheet_name=0) # type: ignore [no-any-return]
207207
except Exception as exc:
208208
calamine_exc = exc
209209
if logger:
@@ -225,7 +225,7 @@ def open_and_parse_file(
225225
with warnings.catch_warnings(record=True) as warning_records:
226226
warnings.simplefilter("always")
227227
with pd.ExcelFile(fp, engine="openpyxl") as excel_file: # type: ignore [arg-type, call-overload]
228-
df = excel_file.parse() # type: ignore [no-any-return]
228+
df = excel_file.parse(sheet_name=0) # type: ignore [no-any-return]
229229
if logger:
230230
for warning in warning_records:
231231
logger.warning(

0 commit comments

Comments
 (0)