Skip to content

Issue GoogleSheetExtractor with empty sheet.  #639

@scyzoryck

Description

@scyzoryck

Hi!

We found a weird edge case when using the GoogleSheetExtractor - when trying to load data from completely empty sheet the return of google response is null.

# vendor/flow-php/etl-adapter-google-sheet/src/Flow/ETL/Adapter/GoogleSheet/GoogleSheetExtractor.php:47
        /** @var Sheets\ValueRange $response */
        $response = $this->service->spreadsheets_values->get($this->spreadsheetId, $cellsRange->toString(), $this->options);
        /** @var array[] $values */
        $values = $response->getValues();

In reality it should be

# vendor/flow-php/etl-adapter-google-sheet/src/Flow/ETL/Adapter/GoogleSheet/GoogleSheetExtractor.php:47
        /** @var Sheets\ValueRange $response */
        $response = $this->service->spreadsheets_values->get($this->spreadsheetId, $cellsRange->toString(), $this->options);
        /** @var null|array[] $values */
        $values = $response->getValues();

I feel like the issue is on the Google repository side, but may it would be worth to handle this edgecase in the package as well? I can provide a fix if needed.

Best, Marcin.

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