airbytehq / airbyte

The leading data integration platform for ETL / ELT data pipelines from APIs, databases & files to data warehouses, data lakes & data lakehouses. Both self-hosted and Cloud-hosted.
https://airbyte.com
Other
15.4k stars 3.97k forks source link

Improve error messages for YouTube Analytics source #26800

Open nataliekwong opened 1 year ago

nataliekwong commented 1 year ago

Improve the error messages emitted for the Youtube Analytics source.

Error Type: Not sure

The Youtube account is not valid. Please make sure you're trying to use the active Youtube Account connected to your Google Account.

Suggestion: Not sure at this time - need more information on why this error message shows up.

jovezhong commented 10 months ago

+1

gregonarash commented 9 months ago

@jovezhong @nataliekwong

I was facing the same issue described here by @jovezhong https://github.com/airbytehq/airbyte/issues/32433

The error account not valid:

The Youtube account is not valid. Please make sure you're trying to use the active Youtube Account connected to your Google Account.

Seem to be generated by this piece of connector code:

    def check_connection(self, logger, config) -> Tuple[bool, any]:
        authenticator = self.get_authenticator(config)
        jobs_resource = JobsResource(authenticator=authenticator)
        result = jobs_resource.list()
        if result:
            return True, None
        else:
            return (
                False,
                "The Youtube account is not valid. Please make sure you're trying to use the active Youtube Account connected to your Google Account.",
            )

https://github.com/airbytehq/airbyte/blob/6fce769ce3a5e131b04ec60e4a9c5de5330b2806/airbyte-integrations/connectors/source-youtube-analytics/source_youtube_analytics/source.py#L266

I am just figuring out this API - so making some assumptions:

https://developers.google.com/youtube/reporting/v1/reference/rest/v1/jobs/create?apix_params=%7B%22prettyPrint%22%3Atrue%2C%22resource%22%3A%7B%22reportTypeId%22%3A%22channel_annotations_a1%22%2C%22name%22%3A%22tst1%22%7D%7D

I cannot say yet if the Airtbyte connector gets all the reports with data or only the one for which I called jobs.create. Might need to wait 24 hours for report to be generated.