Skip to content

Bug: Owner records with more than three fields are discarded #67

Description

@MozzamShahid

File / lines: src/gmaps_scraper/parser.py, lines 377-392

Problem: _parse_list_owner rejects any owner list whose length exceeds 3. Google may append extra metadata (e.g., a verification flag) to owner payloads, which would cause the owner, collaborators, and added_by fields to disappear.

Evidence:

def _parse_list_owner(node: JSONValue | None) -> ListOwner | None:
    if not isinstance(node, list) or len(node) < 1 or len(node) > 3:
        return None

Suggested fix:

  1. Accept len(node) >= 1, read only indices 0–2, and ignore any extra fields.
  2. Add a test fixture with a 4-element owner record.
  3. Verify that extra fields do not change the parsed owner.

Difficulty: good first issue
Impact: Low-Medium — prevents silent data loss when Google adds owner metadata.

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