Currently, montage.loaders.get_entries_from_gsheet attempts to fall back to load_partial_csv if a Google Sheet lacks standard full CSV columns. However, it passes a requests.models.Response object directly into load_partial_csv, which strictly expects a unicodecsv.DictReader instance.
This guarantees a TypeError in all fallback scenarios, which is silently masked by a broad except (ValueError, TypeError): block that subsequently forces the code down the unstructured load_name_list pipeline.
Proposed:
- Refactor
get_entries_from_gsheet so load_partial_csv appropriately receives the initialized DictReader rather than the overarching resp object.
- Remove the silent broad exception catch (
except (ValueError, TypeError):) protecting this layer so failures explicitly surface instead of permanently deflecting to the load_name_list fallback path.
- This will standardize CSV pipeline flows and reduce unexpected metadata losses when dealing with malformed Sheets.
Currently,
montage.loaders.get_entries_from_gsheetattempts to fall back toload_partial_csvif a Google Sheet lacks standard full CSV columns. However, it passes arequests.models.Responseobject directly intoload_partial_csv, which strictly expects aunicodecsv.DictReaderinstance.This guarantees a
TypeErrorin all fallback scenarios, which is silently masked by a broadexcept (ValueError, TypeError):block that subsequently forces the code down the unstructuredload_name_listpipeline.Proposed:
get_entries_from_gsheetsoload_partial_csvappropriately receives the initializedDictReaderrather than the overarchingrespobject.except (ValueError, TypeError):) protecting this layer so failures explicitly surface instead of permanently deflecting to theload_name_listfallback path.