ingestr 0.6.2__tar.gz → 0.6.4__tar.gz
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.
- {ingestr-0.6.2 → ingestr-0.6.4}/PKG-INFO +1 -1
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/gorgias/helpers.py +21 -4
- ingestr-0.6.4/ingestr/src/version.py +1 -0
- ingestr-0.6.2/ingestr/src/version.py +0 -1
- {ingestr-0.6.2 → ingestr-0.6.4}/.dockerignore +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/.github/workflows/deploy-docs.yml +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/.github/workflows/docker.yml +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/.gitignore +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/.python-version +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/Dockerfile +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/LICENSE.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/Makefile +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/README.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/.vitepress/config.mjs +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/.vitepress/theme/custom.css +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/.vitepress/theme/index.js +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/commands/example-uris.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/commands/ingest.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/getting-started/core-concepts.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/getting-started/incremental-loading.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/getting-started/quickstart.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/getting-started/telemetry.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/index.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/bigquery.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/csv.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/databricks.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/duckdb.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/gorgias.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/gsheets.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/mongodb.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/mssql.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/mysql.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/notion.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/oracle.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/overview.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/postgres.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/redshift.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/sap-hana.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/shopify.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/snowflake.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/docs/supported-sources/sqlite.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/main.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/main_test.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/destinations.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/destinations_test.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/factory.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/factory_test.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/google_sheets/README.md +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/google_sheets/__init__.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/google_sheets/helpers/__init__.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/google_sheets/helpers/api_calls.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/google_sheets/helpers/data_processing.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/gorgias/__init__.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/gorgias/helpers_test.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/mongodb/__init__.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/mongodb/helpers.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/notion/__init__.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/notion/helpers/__init__.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/notion/helpers/client.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/notion/helpers/database.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/notion/settings.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/shopify/__init__.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/shopify/exceptions.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/shopify/helpers.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/shopify/settings.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/sources.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/sources_test.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/sql_database/__init__.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/sql_database/helpers.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/sql_database/override.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/sql_database/schema_types.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/telemetry/event.py +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/src/testdata/fakebqcredentials.json +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/testdata/.gitignore +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/testdata/create_replace.csv +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/testdata/delete_insert_expected.csv +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/testdata/delete_insert_part1.csv +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/testdata/delete_insert_part2.csv +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/testdata/merge_expected.csv +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/testdata/merge_part1.csv +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/ingestr/testdata/merge_part2.csv +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/package-lock.json +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/package.json +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/pyproject.toml +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/requirements-dev.txt +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/requirements.txt +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/resources/demo.gif +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/resources/demo.tape +0 -0
- {ingestr-0.6.2 → ingestr-0.6.4}/resources/ingestr.svg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: ingestr
|
|
3
|
-
Version: 0.6.
|
|
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
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Gorgias source helpers"""
|
|
2
2
|
|
|
3
|
+
import time
|
|
3
4
|
from typing import Any, Iterable, Optional, Tuple
|
|
4
5
|
|
|
5
6
|
from dlt.common.pendulum import pendulum
|
|
@@ -9,6 +10,8 @@ from dlt.sources.helpers import requests
|
|
|
9
10
|
from pyrate_limiter import Duration, Limiter, Rate
|
|
10
11
|
from requests.auth import HTTPBasicAuth
|
|
11
12
|
|
|
13
|
+
RETRY_COUNT = 10
|
|
14
|
+
|
|
12
15
|
|
|
13
16
|
def get_max_datetime_from_datetime_fields(
|
|
14
17
|
item: Dict[str, Any],
|
|
@@ -104,10 +107,24 @@ class GorgiasApi:
|
|
|
104
107
|
|
|
105
108
|
while True:
|
|
106
109
|
limiter.try_acquire(f"gorgias-{self.domain}")
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
)
|
|
110
|
-
|
|
110
|
+
|
|
111
|
+
# this is to retry a back-off if we get a 429
|
|
112
|
+
for i in range(RETRY_COUNT):
|
|
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
|
+
)
|
|
123
|
+
time.sleep(retry_after)
|
|
124
|
+
continue
|
|
125
|
+
|
|
126
|
+
break
|
|
127
|
+
|
|
111
128
|
if len(response.json()["data"]) == 0:
|
|
112
129
|
break
|
|
113
130
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.6.4"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.6.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|