Skip to content

Commit

Permalink
Remove redundant code (#43)
Browse files Browse the repository at this point in the history
* Remove duplicate API calls

* update requests from 2.23.0 to 2.31.0, tap version and changelog.md
  • Loading branch information
sgandhi1311 authored Jan 25, 2024
1 parent 85db925 commit 9607a17
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0.3
* Eliminate repetition of API calls
* [#43](https://github.com/singer-io/tap-recharge/pull/43)

## 2.0.2
* Adds ChunkedEncodingError to backoff handling
* Adds unittest
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from setuptools import setup, find_packages

setup(name='tap-recharge',
version='2.0.2',
version='2.0.3',
description='Singer.io tap for extracting data from the ReCharge Payments API 2.0',
author='[email protected]',
classifiers=['Programming Language :: Python :: 3 :: Only'],
py_modules=['tap_recharge'],
install_requires=[
'backoff==1.8.0',
'requests==2.23.0',
'requests==2.31.0',
'singer-python==5.10.0'
],
entry_points='''
Expand Down
7 changes: 0 additions & 7 deletions tap_recharge/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,6 @@ def request(self, method, path=None, url=None, **kwargs): # pylint: disable=too-
if method == 'POST':
kwargs['headers']['Content-Type'] = 'application/json'

with metrics.http_request_timer(endpoint) as timer:
response = self.__session.request(method, url, stream=True, timeout=self.request_timeout, **kwargs)
timer.tags[metrics.Tag.http_status_code] = response.status_code

if response.status_code != 200:
raise_for_error(response)

# Intermittent JSONDecodeErrors when parsing JSON; Adding 2 attempts
# FIRST ATTEMPT
with metrics.http_request_timer(endpoint) as timer:
Expand Down

0 comments on commit 9607a17

Please sign in to comment.