luxorasap 0.1.16__tar.gz → 0.1.17__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.
- {luxorasap-0.1.16 → luxorasap-0.1.17}/PKG-INFO +1 -1
- {luxorasap-0.1.16 → luxorasap-0.1.17}/pyproject.toml +2 -2
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/__init__.py +1 -1
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/ingest/cloud/__init__.py +6 -3
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap.egg-info/PKG-INFO +1 -1
- {luxorasap-0.1.16 → luxorasap-0.1.17}/tests/test_ingest_cloud.py +6 -2
- {luxorasap-0.1.16 → luxorasap-0.1.17}/README.md +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/setup.cfg +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/btgapi/__init__.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/btgapi/auth.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/btgapi/reports.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/btgapi/trades.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/datareader/__init__.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/datareader/core.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/ingest/__init__.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/ingest/legacy_local/dataloader.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/utils/__init__.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/utils/dataframe/__init__.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/utils/dataframe/reader.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/utils/dataframe/transforms.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/utils/storage/__init__.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap/utils/storage/blob.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap.egg-info/SOURCES.txt +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap.egg-info/dependency_links.txt +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap.egg-info/entry_points.txt +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap.egg-info/requires.txt +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/src/luxorasap.egg-info/top_level.txt +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/tests/test_btgapi_auth.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/tests/test_btgapi_reports.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/tests/test_btgapi_trades.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/tests/test_datareader.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/tests/test_ingest_legacy_local.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/tests/test_utils_dataframe.py +0 -0
- {luxorasap-0.1.16 → luxorasap-0.1.17}/tests/test_utils_storage.py +0 -0
|
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
|
|
|
10
10
|
#############################
|
|
11
11
|
[project]
|
|
12
12
|
name = "luxorasap"
|
|
13
|
-
version = "0.1.
|
|
13
|
+
version = "0.1.17"
|
|
14
14
|
description = "Toolbox da Luxor para ingestão, análise e automação de dados financeiros."
|
|
15
15
|
readme = "README.md"
|
|
16
16
|
requires-python = ">=3.9"
|
|
@@ -78,7 +78,7 @@ exclude = ["tests*"]
|
|
|
78
78
|
# bumpver (sem-ver)
|
|
79
79
|
#############################
|
|
80
80
|
[tool.bumpver]
|
|
81
|
-
current_version = "0.1.
|
|
81
|
+
current_version = "0.1.17"
|
|
82
82
|
version_pattern = "MAJOR.MINOR.PATCH"
|
|
83
83
|
|
|
84
84
|
# regex explícito – obrigatório no bumpver 2024+
|
|
@@ -13,7 +13,7 @@ from types import ModuleType
|
|
|
13
13
|
try:
|
|
14
14
|
__version__: str = metadata.version(__name__)
|
|
15
15
|
except metadata.PackageNotFoundError: # editable install
|
|
16
|
-
__version__ = "0.1.
|
|
16
|
+
__version__ = "0.1.17"
|
|
17
17
|
|
|
18
18
|
# ─── Lazy loader ─────────────────────────────────────────────────
|
|
19
19
|
def __getattr__(name: str) -> ModuleType:
|
|
@@ -21,7 +21,8 @@ def save_table(
|
|
|
21
21
|
index_name: str = "index",
|
|
22
22
|
normalize_columns: bool = True,
|
|
23
23
|
directory: str = "enriched/parquet",
|
|
24
|
-
override=False
|
|
24
|
+
override=False,
|
|
25
|
+
large_df: bool = False
|
|
25
26
|
):
|
|
26
27
|
"""Salva DataFrame como Parquet em ADLS (sobrescrevendo)."""
|
|
27
28
|
|
|
@@ -34,7 +35,7 @@ def save_table(
|
|
|
34
35
|
return
|
|
35
36
|
|
|
36
37
|
df = prep_for_save(df, index=index, index_name=index_name, normalize=normalize_columns)
|
|
37
|
-
_client.write_df(df.astype(str), f"{directory}/{table_name}.parquet")
|
|
38
|
+
_client.write_df(df.astype(str), f"{directory}/{table_name}.parquet", large_df=large_df)
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
def incremental_load(
|
|
@@ -47,6 +48,7 @@ def incremental_load(
|
|
|
47
48
|
index_name: str = "index",
|
|
48
49
|
normalize_columns: bool = True,
|
|
49
50
|
directory: str = "enriched/parquet",
|
|
51
|
+
large_df: bool = False
|
|
50
52
|
):
|
|
51
53
|
"""Concatena novos dados aos existentes, cortando duplicados pela data."""
|
|
52
54
|
df["Last_Updated"] = dt.datetime.now()
|
|
@@ -64,5 +66,6 @@ def incremental_load(
|
|
|
64
66
|
index_name=index_name,
|
|
65
67
|
normalize_columns=normalize_columns,
|
|
66
68
|
directory=directory,
|
|
67
|
-
override=True
|
|
69
|
+
override=True,
|
|
70
|
+
large_df=large_df
|
|
68
71
|
)
|
|
@@ -6,15 +6,19 @@ import luxorasap.ingest.cloud as cloud
|
|
|
6
6
|
|
|
7
7
|
def test_save_table_calls_blob_client(fake_blob, monkeypatch):
|
|
8
8
|
captured = {}
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
def fake_write(df, path, large_df):
|
|
10
11
|
captured["df"] = df.copy()
|
|
11
12
|
captured["path"] = path
|
|
13
|
+
captured["large_df"] = large_df
|
|
14
|
+
|
|
12
15
|
monkeypatch.setattr(cloud, "_client", SimpleNamespace(write_df=fake_write))
|
|
13
16
|
|
|
14
17
|
df = pd.DataFrame({"x": [1]})
|
|
15
18
|
cloud.save_table("t1", df, directory="dir")
|
|
16
19
|
assert captured["path"] == "dir/t1.parquet"
|
|
17
20
|
assert captured["df"].equals(df.astype(str))
|
|
21
|
+
|
|
18
22
|
|
|
19
23
|
def test_incremental_load_merges_correctly(fake_blob, monkeypatch):
|
|
20
24
|
# stub LuxorQuery
|
|
@@ -26,5 +30,5 @@ def test_incremental_load_merges_correctly(fake_blob, monkeypatch):
|
|
|
26
30
|
writes = {}
|
|
27
31
|
monkeypatch.setattr(cloud, "_client", SimpleNamespace(write_df=lambda df, p: writes.setdefault("df", df)))
|
|
28
32
|
new = pd.DataFrame({"Date":[dt.date(2024,1,2)], "v":[2]})
|
|
29
|
-
cloud.incremental_load(stub_lq, "prices", new, increment_column="Date")
|
|
33
|
+
cloud.incremental_load(stub_lq, "prices", new, increment_column="Date", large_df=False)
|
|
30
34
|
assert len(writes["df"]) == 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
|