ingestr 0.6.3__py3-none-any.whl → 0.6.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ingestr might be problematic. Click here for more details.

@@ -10,7 +10,7 @@ from dlt.sources.helpers import requests
10
10
  from pyrate_limiter import Duration, Limiter, Rate
11
11
  from requests.auth import HTTPBasicAuth
12
12
 
13
- RETRY_COUNT = 3
13
+ RETRY_COUNT = 10
14
14
 
15
15
 
16
16
  def get_max_datetime_from_datetime_fields(
@@ -110,16 +110,19 @@ class GorgiasApi:
110
110
 
111
111
  # this is to retry a back-off if we get a 429
112
112
  for i in range(RETRY_COUNT):
113
- response = requests.get(
114
- url, params=params, auth=HTTPBasicAuth(self.email, self.api_key)
115
- )
116
-
117
- if response.status_code == 429:
118
- retry_after = int(response.headers.get("Retry-After", 2))
113
+ try:
114
+ response = requests.get(
115
+ url, params=params, auth=HTTPBasicAuth(self.email, self.api_key)
116
+ )
117
+ except Exception as e:
118
+ retry_after = int(response.headers.get("Retry-After", 10))
119
+ print(
120
+ f"Got an error from Gorgias API, retrying after {retry_after} seconds",
121
+ e,
122
+ )
119
123
  time.sleep(retry_after)
120
124
  continue
121
125
 
122
- response.raise_for_status()
123
126
  break
124
127
 
125
128
  if len(response.json()["data"]) == 0:
ingestr/src/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.6.3"
1
+ __version__ = "0.6.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ingestr
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: ingestr is a command-line application that ingests data from various sources and stores them in any database.
5
5
  Project-URL: Homepage, https://github.com/bruin-data/ingestr
6
6
  Project-URL: Issues, https://github.com/bruin-data/ingestr/issues
@@ -6,14 +6,14 @@ ingestr/src/factory.py,sha256=7skwetBXFIwAuKyTFfffGPgSo_PRRZ5uEnxOHUv28yQ,3517
6
6
  ingestr/src/factory_test.py,sha256=X9sFkvNByWChIcyeDt1QiIPMIzGNKb7M5A_GUE0-nnI,664
7
7
  ingestr/src/sources.py,sha256=v0oFu-Pt_Zv06FypBb9_rHKP_iIMpkgm9MMaVpOUjPg,10313
8
8
  ingestr/src/sources_test.py,sha256=t94u1lYAspxzfe-DkxVtq5vw6xrLWphipvwntrwrzqg,3930
9
- ingestr/src/version.py,sha256=zYiFHqR7JwbvdK9dvKrh-RTNfUqjHUwC4CTcFAPVYLc,22
9
+ ingestr/src/version.py,sha256=WMmvm2Keb76yMz8OL_h4fKT34Xpi-1BVfCiTn2QGzz4,22
10
10
  ingestr/src/google_sheets/README.md,sha256=wFQhvmGpRA38Ba2N_WIax6duyD4c7c_pwvvprRfQDnw,5470
11
11
  ingestr/src/google_sheets/__init__.py,sha256=5qlX-6ilx5MW7klC7B_0jGSxloQSLkSESTh4nlY3Aos,6643
12
12
  ingestr/src/google_sheets/helpers/__init__.py,sha256=5hXZrZK8cMO3UOuL-s4OKOpdACdihQD0hYYlSEu-iQ8,35
13
13
  ingestr/src/google_sheets/helpers/api_calls.py,sha256=RiVfdacbaneszhmuhYilkJnkc9kowZvQUCUxz0G6SlI,5404
14
14
  ingestr/src/google_sheets/helpers/data_processing.py,sha256=WYO6z4XjGcG0Hat2J2enb-eLX5mSNVb2vaqRE83FBWU,11000
15
15
  ingestr/src/gorgias/__init__.py,sha256=iASGYJhdx6yZ0uDgIaQQfW91l3p0XOhowalIByLFkvw,21228
16
- ingestr/src/gorgias/helpers.py,sha256=VtmzbYNWxYthK80ZTVmVijiN7VHmj3k8NQyTnAlIUJU,5274
16
+ ingestr/src/gorgias/helpers.py,sha256=DamuijnvhGY9hysQO4txrVMf4izkGbh5qfBKImdOINE,5427
17
17
  ingestr/src/gorgias/helpers_test.py,sha256=kSR2nhB8U8HZ8pgDnd7HvXlzojmBnpOm8fTKHJvvKGY,1580
18
18
  ingestr/src/mongodb/__init__.py,sha256=E7SDeCyYNkYZZ_RFhjCRDZUGpKtaxpPG5sFSmKJV62U,4336
19
19
  ingestr/src/mongodb/helpers.py,sha256=80vtAeNyUn1iMN0CeLrTlKqYN6I6fHF81Kd2UuE8Kns,5653
@@ -40,8 +40,8 @@ ingestr/testdata/delete_insert_part2.csv,sha256=B_KUzpzbNdDY_n7wWop1mT2cz36TmayS
40
40
  ingestr/testdata/merge_expected.csv,sha256=DReHqWGnQMsf2PBv_Q2pfjsgvikYFnf1zYcQZ7ZqYN0,276
41
41
  ingestr/testdata/merge_part1.csv,sha256=Pw8Z9IDKcNU0qQHx1z6BUf4rF_-SxKGFOvymCt4OY9I,185
42
42
  ingestr/testdata/merge_part2.csv,sha256=T_GiWxA81SN63_tMOIuemcvboEFeAmbKc7xRXvL9esw,287
43
- ingestr-0.6.3.dist-info/METADATA,sha256=xJBCic9HzOfV4YmOedSoQZDB2QT-VPIa4XSgdAPMxGs,5699
44
- ingestr-0.6.3.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
45
- ingestr-0.6.3.dist-info/entry_points.txt,sha256=oPJy0KBnPWYjDtP1k8qwAihcTLHSZokSQvRAw_wtfJM,46
46
- ingestr-0.6.3.dist-info/licenses/LICENSE.md,sha256=cW8wIhn8HFE-KLStDF9jHQ1O_ARWP3kTpk_-eOccL24,1075
47
- ingestr-0.6.3.dist-info/RECORD,,
43
+ ingestr-0.6.4.dist-info/METADATA,sha256=P9HvhFDdyABsqWup6JK4-LgdaCDH_UBvTByLtFvxbW4,5699
44
+ ingestr-0.6.4.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
45
+ ingestr-0.6.4.dist-info/entry_points.txt,sha256=oPJy0KBnPWYjDtP1k8qwAihcTLHSZokSQvRAw_wtfJM,46
46
+ ingestr-0.6.4.dist-info/licenses/LICENSE.md,sha256=cW8wIhn8HFE-KLStDF9jHQ1O_ARWP3kTpk_-eOccL24,1075
47
+ ingestr-0.6.4.dist-info/RECORD,,