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-15454 removed the buffer system #77

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

namrata270998
Copy link
Contributor

Description of change

  • Removed the buffer system completely and directly yield the records

Manual QA steps

  • Check that the previous code and the current code produces the same records

Risks

Rollback steps

  • revert this branch

@namrata270998 namrata270998 changed the title removed the buffer systesm removed the buffer system Oct 12, 2021
@namrata270998 namrata270998 changed the title removed the buffer system TDL-15454 removed the buffer system Oct 12, 2021
@mock.patch('tap_zendesk.streams.TicketMetrics.sync')
@mock.patch('tap_zendesk.streams.TicketComments.sync')
@mock.patch('tap_zendesk.streams.CursorBasedExportStream.get_objects')
def test_yield_records(mock_objects, mock_comments_sync, mock_metrics_sync, mock_audits_sync, mock_comments, mock_metrics, mock_audits, mock_get_bookmark, mock_update_bookmark):
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add comments in unit test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -308,12 +275,12 @@ def emit_sub_stream_metrics(sub_stream):
self.update_bookmark(state, utils.strftime(generated_timestamp_dt))

ticket.pop('fields') # NB: Fields is a duplicate of custom_fields, remove before emitting
should_yield = self._buffer_record((self.stream, ticket))
yield (self.stream, ticket)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for yielding self.stream? instead of just ticket

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because the buffer_records also had self.stream passed as an argument. And it helps in identifying which stream is yielded.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes because earlier it is required to identify the stream in function _buffer_record as there is login on the stream name, I don't see that logic now, do we still need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a comment regarding why we are yielding stream name and rec in the code

@dbshah1212 dbshah1212 self-requested a review November 1, 2021 07:03
Copy link
Contributor

@KrisPersonal KrisPersonal left a comment

Choose a reason for hiding this comment

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

Code walk through required

prijendev and others added 2 commits November 10, 2021 11:55
* API call to the each stream in discovery mode done

* removed generated catalog file

* resolved pylint errors

* Resolved cyclic import pylint error

* Improved unittest case civerage

* Updated error message for 403 forbidden error

* Updated error handling

* resolved pylint error

* Removed empty catalog

* Removed unused catalog file.

* Removed unused state file

* Removed unused state file

* Removed unused file

* Updated error message and unittest case for 404 error

* Updated check access method

* Resolved pylint error

* recolved unused argument error

* resolved kwargs error

* Updated unittest cases

* Updated unittest cases

* Removed global variable

* Improved unittest case coverage

* updated 404 error

* resolved pylint error

* Updated typo error.

* Removed f strings

* Updated error handling

* resloved pylint error

* resolved unittest case error

* Added more comments and updated code

* resolved pylint error

* updated method name

* Added timeout error code

* Resolved pylint error

* added coverage report to artifact

* added pylint back

* Added comment

* resolved pylint errors

* Enhanced the code

* Reutilized args0

* Moved request_timeout parameter to common class

* Added comment

* Removed static time

* removed warning message

* resolved pylint error

* resolved the comments

Co-authored-by: namrata270998 <[email protected]>
@dbshah1212 dbshah1212 mentioned this pull request Nov 11, 2021
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