Skip to content
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

🐛 Source Google Ads: Fix custom queries #33603

Merged
merged 7 commits into from Jan 9, 2024

Conversation

tolik0
Copy link
Contributor

@tolik0 tolik0 commented Dec 18, 2023

What

This PR addresses two key issues in the custom queries: automatic addition of segments.date in the query, which hindered some custom queries, and incorrect field type for DATE fields. The changes resolve the following issues:

How

This update introduces a config migration for existing custom queries to align with the new format. It enables the creation of custom queries without the automatic breakdown by time, maintaining compatibility with all previous query formats. Additionally, it corrects the field type for DATE fields by identifying and listing fields that are truly of type date. This correction addresses an issue caused by Google Ads not differentiating between date and datetime fields.

Copy link

vercel bot commented Dec 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 9, 2024 4:42pm

@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/google-ads labels Dec 18, 2023
Copy link
Contributor

github-actions bot commented Dec 18, 2023

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

Copy link
Contributor

github-actions bot commented Dec 21, 2023

Warning

🚨 Connector code freeze is in effect until 2024-01-02. This PR is changing connector code. Please contact the current OC engineers if you want to merge this change to master.

@@ -7,7 +7,7 @@

# pin protobuf==3.20.0 as other versions may cause problems on different architectures
# (see https://github.com/airbytehq/airbyte/issues/13580)
MAIN_REQUIREMENTS = ["airbyte-cdk>=0.51.3", "google-ads==22.1.0", "protobuf", "pendulum"]
MAIN_REQUIREMENTS = ["airbyte-cdk>=0.51.3", "google-ads==22.1.0", "protobuf", "pendulum>=3.0.0"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would not this cause any problem?

pendulum was pinned to <3.0 in CDK
#33572

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned <3.0.0 to align with the CDK

@tolik0 tolik0 force-pushed the tolik0/source-google-ads/fix-custom-queries-segments branch from 3321b2b to fa07d34 Compare December 22, 2023 14:40
Copy link
Contributor

@alafanechere alafanechere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tolik0 I'd prefer that we merge this change in after code freeze.
Did you perform any sort of manual testing to make sure the migration work?
I'd suggest pre-releasing a version and manually test in on an internal cloud workspace to make sure no breaking change is introduced.

class MigrateCustomQuery:
"""
This class stands for migrating the config at runtime,
while providing the backward compatibility when falling back to the previous source version.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please share how backward compatibility is guaranteed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the docs. Backward compatibility is achieved by creating a new property instead of editing an existing one.

@@ -84,7 +84,7 @@
"order": 6,
"format": "date"
},
"custom_queries": {
"custom_queries_array": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we renaming the field?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property was renamed for backwards compatibility. When falling back to the previous version old property will be used.

]


class MigrateCustomQuery:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@airbytehq/connector-extensibility would you consider adding a migration abstract class to the CDK to expose a common migration interface?

| `0.1.1` | 2021-06-23 | [4288](https://github.com/airbytehq/airbyte/pull/4288) | Fix `Bugfix: Correctly declare required parameters` |
| Version | Date | Pull Request | Subject |
|:---------|:-----------|:---------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------|
| `3.1.0` | 2023-12-18 | [33603](https://github.com/airbytehq/airbyte/pull/33603) | Fix custom queries |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please be more descriptive about the changes you made? If it's a minor bump it means that you introduced a new feature and not only a fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@tolik0 tolik0 force-pushed the tolik0/source-google-ads/fix-custom-queries-segments branch from f7f04af to be9cb5e Compare January 9, 2024 16:40
@tolik0 tolik0 merged commit c09d5d3 into master Jan 9, 2024
26 checks passed
@tolik0 tolik0 deleted the tolik0/source-google-ads/fix-custom-queries-segments branch January 9, 2024 17:27
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/google-ads
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants