Skip to content

[source-google-ads] check_connection - TypeError: 'GAQL' object is not subscriptable #59182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task
ross-kortx opened this issue May 1, 2025 · 0 comments
Open
1 task

Comments

@ross-kortx
Copy link

Connector Name

source-google-ads

Connector Version

3.7.10

What step the error happened?

Configuring a new connector

Relevant information

line 186

will throw a TypeError: 'GAQL' object is not subscriptable on the second iteration through customers
because the query object is reassigned

        for query in config.get("custom_queries_array", []):
            for customer in customers:
                table_name = query["table_name"]
                query = query["query"]
                if customer.is_manager_account and self.is_metrics_in_custom_query(query):
                    logger.warning(
                        f"Metrics are not available for manager account {customer.id}. "
                        f'Skipping the custom query: "{query}" for manager account.'
                    )
                    continue

In practice, I can't create a Google Ads Source when the first customer is a manager account

Relevant log output

2025-05-01 11:06:02 info 
2025-05-01 11:06:02 info ----- START CHECK -----
2025-05-01 11:06:02 info 
2025-05-01 11:06:03 info Connector exited, processing output
2025-05-01 11:06:03 info Output file jobOutput.json found
2025-05-01 11:06:03 info Connector exited with exit code 1
2025-05-01 11:06:03 info Reading messages from protocol version 0.2.0
2025-05-01 11:06:03 info Checking the config
2025-05-01 11:06:03 info Found 1 accessible accounts: ['customers/1034550820']
2025-05-01 11:06:03 info Found 80 customers: ['1034550820', '1642048129', '1790810286', '1981530997', '2162347096', '2246395158', '2414450988', '2417285254', '2857022772', '3309508190', '3649969845', '3745425078', '3974892672', '4275634872', '4292516605', '4300044450', '4510081683', '4679645368', '5001784511', '5218497329', '5343774249', '5466834537', '5825037552', '5832695303', '5876941376', '6125193747', '6398657825', '6573817621', '6702121744', '6729330917', '6739175189', '6857402127', '6936548615', '7267424742', '7629720058', '7728358164', '7733682364', '8485782896', '8495811148', '8509352570', '8582705850', '8791730293', '8839553505', '8908821305', '9007882437', '9023336070', '9316831401', '9396140735', '9546612588', '9620655768', '9733007692', '9879853258', '1389116437', '1523299946', '1524506654', '1740816979', '1879363795', '1908188735', '1926757595', '2486462821', '2658253896', '3334012878', '3682853448', '4362192643', '4813566621', '5143242766', '5177696497', '5241920160', '6312036062', '6359845962', '7087116096', '7247688517', '7497652270', '7694370029', '7732720300', '8061261345', '8065574758', '9762514207', '9934701154', '6484899306']
2025-05-01 11:06:03 warn Metrics are not available for manager account 1034550820. Skipping the custom query: "SELECT campaign.id, customer.id, campaign.name, customer.descriptive_name, campaign.advertising_channel_sub_type, campaign.advertising_channel_type, segments.conversion_action, segments.conversion_action_category, segments.conversion_action_name, metrics.all_conversions, metrics.all_conversions_value, metrics.conversions, metrics.conversions_value, segments.date FROM campaign" for manager account.
2025-05-01 11:06:03 error 'GAQL' object is not subscriptable
Traceback (most recent call last):
  File "/airbyte/integration_code/main.py", line 9, in <module>
    run()
  File "/airbyte/integration_code/source_google_ads/run.py", line 16, in run
    launch(source, sys.argv[1:])
  File "/usr/local/lib/python3.10/site-packages/airbyte_cdk/entrypoint.py", line 263, in launch
    for message in source_entrypoint.run(parsed_args):
  File "/usr/local/lib/python3.10/site-packages/airbyte_cdk/entrypoint.py", line 126, in run
    yield from map(AirbyteEntrypoint.airbyte_message_to_string, self.check(source_spec, config))
  File "/usr/local/lib/python3.10/site-packages/airbyte_cdk/entrypoint.py", line 155, in check
    check_result = self.source.check(self.logger, config)
  File "/usr/local/lib/python3.10/site-packages/airbyte_cdk/sources/abstract_source.py", line 81, in check
    check_succeeded, error = self.check_connection(logger, config)
  File "/airbyte/integration_code/source_google_ads/source.py", line 186, in check_connection
    table_name = query["table_name"]
TypeError: 'GAQL' object is not subscriptable
2025-05-01 11:06:03 info Checking for optional control message...
2025-05-01 11:06:03 info Writing output of 253487c0-2246-43ba-a21f-5116b20a2c50_0f2d749c-47e3-48fc-bef8-e2d201f3acc8_0_check to the doc store
2025-05-01 11:06:03 info Marking workload 253487c0-2246-43ba-a21f-5116b20a2c50_0f2d749c-47e3-48fc-bef8-e2d201f3acc8_0_check as successful
2025-05-01 11:06:03 info 
2025-05-01 11:06:03 info ----- END CHECK -----
2025-05-01 11:06:03 info Deliberately exiting process with code 0.
2025-05-01 11:06:03 info

Contribute

  • Yes, I want to contribute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants