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

Tdl 26414 rename custom objects #263

Merged
merged 8 commits into from
Sep 18, 2024
Merged

Conversation

RushiT0122
Copy link
Contributor

@RushiT0122 RushiT0122 commented Sep 12, 2024

Description of change

This PR addresses an issue where custom objects in HubSpot can have the same names as standard objects (e.g., contacts, campaigns), leading to extraction failures TDL-26380.

The fix involves renaming custom objects that share names with standard objects to a distinct custom_object_<standard_object_name>. This ensures that custom objects are clearly differentiated from standard objects, preventing conflicts and extraction issues.

Manual QA steps

  • Verify that streams of conflicting custom objects have been renamed correctly.
  • Verify that custom objects initially named custom_object_<standard_object_name> are extracted as expected.
  • Verify that the standard and renamed custom object streams are extracted properly.

Risks

Rollback steps

  • revert this branch

@sgandhi1311
Copy link
Member

Can you please pull the latest changes from the master branch?

@@ -1422,6 +1426,7 @@ def discover_schemas():
LOGGER.info('Loading schema for Custom Object - %s', custom_stream["stream"].tap_stream_id)
result['streams'].append({'stream': custom_stream["stream"].tap_stream_id,
'tap_stream_id': custom_stream["stream"].tap_stream_id,
"table_name": custom_stream["custom_object_name"],
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to have new key table_name? Because it looks like standard ojects won't be having that key.

Copy link
Contributor Author

@RushiT0122 RushiT0122 Sep 13, 2024

Choose a reason for hiding this comment

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

Yes, this stream property value will be reflected on the app and in the extracted records. Whereas table_name will retain the original object name which we need to make API requests.

self.EXPECTED_PAGE_SIZE: 100,
self.OBEYS_START_DATE: True
},
"custom_object_contacts": {
Copy link
Member

Choose a reason for hiding this comment

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

How about testing the corner case scenario for the stream name like - custom_object_custom_object_contacts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only rename custom objects stream if their original name matches with standard stream names like contacts, campaigns, deals. Therefore, if custom object is named as custom_object_custom_object_contacts then we won't take any action on it.

@RushiT0122 RushiT0122 merged commit 695c5b5 into master Sep 18, 2024
13 checks passed
@RushiT0122 RushiT0122 deleted the TDL-26414-rename-custom-objects branch September 18, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants