Skip to content

Inconsistency: load_partial_csv fallback permanently fails during Google Sheet imports #517

@ayushshukla1807

Description

@ayushshukla1807

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:

  1. Refactor get_entries_from_gsheet so load_partial_csv appropriately receives the initialized DictReader rather than the overarching resp object.
  2. 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.
  3. This will standardize CSV pipeline flows and reduce unexpected metadata losses when dealing with malformed Sheets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions