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

changes to make tap compatible with singer-python 6.0.0 #195

Merged
merged 7 commits into from
Feb 6, 2024

Conversation

rdeshmukh15
Copy link
Contributor

@rdeshmukh15 rdeshmukh15 commented Jan 25, 2024

Description of change

  • Fix to make tap compatible with singer-python 6.0.0 TDL-24831
  • With the existing code, tap was not able to handle the empty string fields and was throwing error like this:
2024-01-24 14:26:57,161Z    tap - CRITICAL You cannot set line2 to an empty string on this object. The empty string is treated specially in our requests. If you'd like to delete the property using the save() method on this object, you may set {
2024-01-24 14:26:57,161Z    tap - CRITICAL   "city": "dreamcity",
2024-01-24 14:26:57,161Z    tap - CRITICAL   "country": null,
2024-01-24 14:26:57,161Z    tap - CRITICAL   "line1": "122 king's palace",
2024-01-24 14:26:57,161Z    tap - CRITICAL   "line2": "",
2024-01-24 14:26:57,161Z    tap - CRITICAL   "postal_code": "123456",
2024-01-24 14:26:57,162Z    tap - CRITICAL   "state": "AB"
2024-01-24 14:26:57,162Z    tap - CRITICAL }.line2=None. Alternatively, you can pass line2='' to delete the property when using a resource method such as modify().

And it is caused due to the convert_dict_to_stripe_object function. This function converts the dict objects to StripeObject basically jsonifies the dictionaries in the list.
If input record is :
{'id': 'dummy_id', 'tiers': [{'flat_amount': 4578, 'unit_amount': 7241350}]}

with convert_dict_to_stripe_object function, we get below record:

{'id': 'dummy_id', 'tiers': [<StripeObject at 0x7f746b665c20> JSON: {
  "flat_amount": 4578,
  "unit_amount": 7241350
}]}

Without converting the dict to stripe object no schema/output changes observed. Hence, removing the particular function and its occurrences.

Manual QA steps

  • Verified by running sync and validated record counts
  • Did a PR alpha for one of the customers and their integration is running properly.
  • Ran tap tester tests

Risks

Rollback steps

  • revert this branch

@rdeshmukh15 rdeshmukh15 changed the title changes to make tap compatible with python 3.11.7 changes to make tap compatible with singer-python 6.0.0 Jan 25, 2024
@rdeshmukh15 rdeshmukh15 marked this pull request as ready for review January 25, 2024 13:06
@rdeshmukh15 rdeshmukh15 merged commit 6bbae48 into master Feb 6, 2024
20 checks passed
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