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-19413: Products stream will not be supported in new version for certain PIMs #29

Conversation

hpatel41
Copy link
Contributor

@hpatel41 hpatel41 commented Jun 15, 2022

Description of change

TDL-19413: Products stream will not be supported in new version for certain PIMs

  • Updated the code to use Old API Verison (2021-01) for the Products stream.
  • NOTE: In the API Changelog it is mentioned that to get Products in New Version: 2021-11 we can use /plans, but we have found major field changes (Tap-Recharge_ Products vs Plans.pdf) for Plans endpoint thus, we will use Old Verison for this endpoint.

Manual QA steps

Risks

Rollback steps

  • revert this branch

Test case to verify we are calling stream 'Products' with API Version: '2021-01'
"""
# mock request and return value with data key
mocked_request.return_value = Mockresponse({'products': [{'key': 'value'}]})
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this return_value at the decorator level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the unittest.

Test case to verify we are calling stream other than 'Products' with API Version: '2021-11'
"""
# mock request and return value with data key
mocked_request.return_value = Mockresponse({'collections': [{'key': 'value'}]})
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this return_value at the decorator level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the unittest.

Comment on lines 193 to 194
# In API Version: 2021-11, Products endpoint is only available for merchants doing a custom integration
# with a PIM (Product Information Management) system that isn’t Shopify or BigCommerce.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# In API Version: 2021-11, Products endpoint is only available for merchants doing a custom integration
# with a PIM (Product Information Management) system that isn’t Shopify or BigCommerce.
# In API Version: 2021-11, the Products endpoint is only available for merchants doing a custom integration
# with a PIM (Product Information Management) system that isn’t Shopify or BigCommerce
# hence keep API version 2021-01 for Products.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated comment.

@@ -190,6 +190,12 @@ def request(self, method, path=None, url=None, **kwargs): # pylint: disable=too-
if path == 'collections':

Choose a reason for hiding this comment

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

How this PR is different then https://github.com/singer-io/tap-recharge/pull/32/files
Can we merge everything in one?

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, PR contains all the changes related to the Products stream. And PR #32 is general missing fields PR for all the streams.

@hpatel41 hpatel41 requested a review from dbshah1212 July 7, 2022 05:15
@hpatel41 hpatel41 requested a review from luandy64 July 19, 2022 10:49
 into TDL-19413-Products-stream-will-not-be-supported-in-new-version
@hpatel41 hpatel41 merged commit 132a024 into crest-master Jul 20, 2022
@hpatel41 hpatel41 mentioned this pull request Jul 20, 2022
RushiT0122 pushed a commit that referenced this pull request Aug 4, 2022
* TDL-19329: Update Pagination to cursor based for certain streams (#34)

* updated the pagination to cursor-based from page-based

* resolved unittests failure

* added unittests

* updated code and unittests

* TDL-19325: Add missing fields (#32)

* added missing fields and newly added fields due to api upgrade

* resolve unittest failure

* added missing fields and updated datatype for some fields

* added some missing fields

* updated code to use old API verison for onetimes stream

* updated unittest as per comments

* updated the request timeout unittest

* updated the request timeout unittest to use parameterized test data

* TDL-19414: Update datatype for some fields (#33)

* updated datatype for some fields

* resolved unittest failure

* updated schema

* added code to use old verison for onetimes stream

* updated unittests

* TDL-19326: Add missing integration tests (#31)

* Added missing integration test and missing assertions

* Ignored some fields in all_field test

* Updated code formatting for start_date test

* Updated code comments

* Added tap-tester test for interrupted sync

* Updated comment

Co-authored-by: harshpatel4crest <harsh.patel4@crestdatasys.com>

* TDL-19330: Add error logging (#30)

* added custom error handling

* updated logger.error message

* resolve pylint error

* updated 429 error class name

* updated unittests

* updated unittests

* resolved comments

* updated test cases with parameterized tests

* updated config.yml file

* updated unittests

* updated unittests

* TDL-19413: Products stream will not be supported in new version for certain PIMs (#29)

* added code to use old API for products strean

* updated unittests

* updated products schema

* updated comment

* TDL-19328: Change Shop API (#27)

* updated shop endpoint to store

* updated shop endpoint to /store

* updated readme file and changed shop to store

* added a field in store stream

* added default_api_version field in shop schema

Co-authored-by: Harsh Patel4 <harsh.patel4@CDSYS.LOCAL>

* updated the all fields test

* reverted the datatype change for a field in discounts stream

Co-authored-by: savan-chovatiya <80703490+savan-chovatiya@users.noreply.github.com>
Co-authored-by: Harsh Patel4 <harsh.patel4@CDSYS.LOCAL>
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.

5 participants