python-databases 2.1.0__tar.gz → 2.2.0__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.
- {python_databases-2.1.0/python_databases.egg-info → python_databases-2.2.0}/PKG-INFO +1 -2
- {python_databases-2.1.0 → python_databases-2.2.0}/pyproject.toml +1 -2
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases/elasticsearch_infrastructure/elasticsearch.py +0 -14
- {python_databases-2.1.0 → python_databases-2.2.0/python_databases.egg-info}/PKG-INFO +1 -2
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases.egg-info/requires.txt +0 -1
- {python_databases-2.1.0 → python_databases-2.2.0}/tests/test_elasticsearch.py +0 -26
- {python_databases-2.1.0 → python_databases-2.2.0}/LICENSE +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/MANIFEST.in +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/README.md +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases/__init__.py +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases/consts.py +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases/elasticsearch_infrastructure/__init__.py +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases/elasticsearch_infrastructure/consts.py +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases/postgresql_infrastructure/__init__.py +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases/postgresql_infrastructure/consts.py +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases/postgresql_infrastructure/postgresql.py +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases.egg-info/SOURCES.txt +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases.egg-info/dependency_links.txt +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/python_databases.egg-info/top_level.txt +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/setup.cfg +0 -0
- {python_databases-2.1.0 → python_databases-2.2.0}/tests/test_postgres.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-databases
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: A Python library for managing and interacting with multiple databases seamlessly.
|
|
5
5
|
Author: Avi Zaguri
|
|
6
6
|
License: MIT
|
|
@@ -18,7 +18,6 @@ Description-Content-Type: text/markdown
|
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: custom-python-logger>=4.2.0
|
|
20
20
|
Requires-Dist: elasticsearch<9,>=8.19.3
|
|
21
|
-
Requires-Dist: pandas>=3.1.1
|
|
22
21
|
Requires-Dist: psycopg2-binary>=2.9.13
|
|
23
22
|
Requires-Dist: python-dotenv>=1.2.4
|
|
24
23
|
Requires-Dist: retrying>=1.4.2
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-databases"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.2.0"
|
|
8
8
|
description = "A Python library for managing and interacting with multiple databases seamlessly."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -23,7 +23,6 @@ classifiers = [
|
|
|
23
23
|
dependencies = [
|
|
24
24
|
"custom-python-logger>=4.2.0",
|
|
25
25
|
"elasticsearch>=8.19.3,<9",
|
|
26
|
-
"pandas>=3.1.1",
|
|
27
26
|
"psycopg2-binary>=2.9.13",
|
|
28
27
|
"python-dotenv>=1.2.4",
|
|
29
28
|
"retrying>=1.4.2",
|
|
@@ -6,7 +6,6 @@ from datetime import UTC, datetime
|
|
|
6
6
|
from enum import Enum
|
|
7
7
|
from typing import Any
|
|
8
8
|
|
|
9
|
-
import pandas as pd
|
|
10
9
|
from custom_python_logger import get_logger
|
|
11
10
|
from elasticsearch import Elasticsearch, helpers
|
|
12
11
|
from retrying import retry
|
|
@@ -212,19 +211,6 @@ class ElasticSearch(ABC):
|
|
|
212
211
|
except Exception as e:
|
|
213
212
|
raise Exception(f"Failed to get documents from index '{index}': {str(e)}") from e
|
|
214
213
|
|
|
215
|
-
def convert_dataframes_to_list_of_docs(
|
|
216
|
-
self,
|
|
217
|
-
dataframe: pd.DataFrame,
|
|
218
|
-
log_progress: bool = False,
|
|
219
|
-
) -> list:
|
|
220
|
-
data = []
|
|
221
|
-
dataframe_values = dataframe.values.tolist()
|
|
222
|
-
for index, value in enumerate(dataframe_values):
|
|
223
|
-
if log_progress:
|
|
224
|
-
self.logger.debug(f"index: {index}/{len(dataframe_values)}")
|
|
225
|
-
data.append(value)
|
|
226
|
-
return data
|
|
227
|
-
|
|
228
214
|
|
|
229
215
|
class ElasticSearchOnPrem(ElasticSearch):
|
|
230
216
|
def __init__(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-databases
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: A Python library for managing and interacting with multiple databases seamlessly.
|
|
5
5
|
Author: Avi Zaguri
|
|
6
6
|
License: MIT
|
|
@@ -18,7 +18,6 @@ Description-Content-Type: text/markdown
|
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: custom-python-logger>=4.2.0
|
|
20
20
|
Requires-Dist: elasticsearch<9,>=8.19.3
|
|
21
|
-
Requires-Dist: pandas>=3.1.1
|
|
22
21
|
Requires-Dist: psycopg2-binary>=2.9.13
|
|
23
22
|
Requires-Dist: python-dotenv>=1.2.4
|
|
24
23
|
Requires-Dist: retrying>=1.4.2
|
|
@@ -10,7 +10,6 @@ from collections.abc import Iterator
|
|
|
10
10
|
from datetime import datetime
|
|
11
11
|
from unittest.mock import MagicMock, call, patch
|
|
12
12
|
|
|
13
|
-
import pandas as pd
|
|
14
13
|
import pytest
|
|
15
14
|
from elasticsearch.helpers import BulkIndexError
|
|
16
15
|
|
|
@@ -421,31 +420,6 @@ def test_get_documents_wraps_and_chains_client_error( # pylint: disable=redefin
|
|
|
421
420
|
assert exc_info.value.__cause__ is original, "original error not chained"
|
|
422
421
|
|
|
423
422
|
|
|
424
|
-
# --------------------------------------------------------------------------- #
|
|
425
|
-
# convert_dataframes_to_list_of_docs
|
|
426
|
-
# --------------------------------------------------------------------------- #
|
|
427
|
-
def test_convert_dataframes_returns_one_entry_per_row( # pylint: disable=redefined-outer-name
|
|
428
|
-
es: _FakeElasticSearch,
|
|
429
|
-
) -> None:
|
|
430
|
-
df = pd.DataFrame({"a": [1, 2], "b": [3, 4]})
|
|
431
|
-
result = es.convert_dataframes_to_list_of_docs(dataframe=df)
|
|
432
|
-
assert len(result) == 2, f"expected one entry per row, got {result}"
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
@pytest.mark.xfail(
|
|
436
|
-
strict=True,
|
|
437
|
-
reason="BUG: convert_dataframes_to_list_of_docs returns bare value lists (df.values.tolist()), "
|
|
438
|
-
"dropping column names. Its output is not consumable by fill_elk_index_as_bulk / _build_document, "
|
|
439
|
-
"which iterate row.items().",
|
|
440
|
-
)
|
|
441
|
-
def test_convert_dataframes_output_is_keyed_by_column( # pylint: disable=redefined-outer-name
|
|
442
|
-
es: _FakeElasticSearch,
|
|
443
|
-
) -> None:
|
|
444
|
-
df = pd.DataFrame({"a": [1, 2], "b": [3, 4]})
|
|
445
|
-
result = es.convert_dataframes_to_list_of_docs(dataframe=df)
|
|
446
|
-
assert result == [{"a": 1, "b": 3}, {"a": 2, "b": 4}], f"column names lost: {result}"
|
|
447
|
-
|
|
448
|
-
|
|
449
423
|
# --------------------------------------------------------------------------- #
|
|
450
424
|
# Concrete connect implementations
|
|
451
425
|
# --------------------------------------------------------------------------- #
|
|
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
|
{python_databases-2.1.0 → python_databases-2.2.0}/python_databases.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|