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-facebook-marketing] Should not run migration if the legacy field account_id is not present #37367

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

brianjlai
Copy link
Contributor

@brianjlai brianjlai commented Apr 17, 2024

Fixes: https://github.com/airbytehq/oncall/issues/4131

We have a bug in our migration code where when we attempt to migrate connections that do not have the legacy account_id and then crash when we read the config object.

This change fixes when we should run the migration by skipping the migration when account_id does not exist and therefore nothing needs to be migrated. I'm not 100% sure how this gets triggered because the new field account_ids is required, but it could be customers using a side path instead of Airbyte's UI.

Copy link

vercel bot commented Apr 17, 2024

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Apr 17, 2024 4:10am

@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/facebook-marketing labels Apr 17, 2024
@@ -38,7 +38,7 @@ def should_migrate(cls, config: Mapping[str, Any]) -> bool:
> False, otherwise.
> Raises the Exception if the structure could not be migrated.
"""
return False if config.get(cls.migrate_to_key) else True
return False if config.get(cls.migrate_to_key) or not config.get(cls.migrate_from_key) else True
Copy link
Contributor

@girarda girarda Apr 17, 2024

Choose a reason for hiding this comment

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

nit: can we simplify this to
return cls.migrate_from_key in config and cls.migrate_from_key not in config
?

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 think you meant return cls.migrate_from_key in config and cls.migrate_to_key not in config. In your snippet you have migrate_from_key twice.

But agree will fix this!

@brianjlai brianjlai merged commit 0f3ab40 into master Apr 17, 2024
35 checks passed
@brianjlai brianjlai deleted the brian/facebook_marketing_fix_account_id_migration branch April 17, 2024 06:48
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/facebook-marketing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants