luxorasap 0.1.27__py3-none-any.whl → 0.1.28__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.
- luxorasap/__init__.py +1 -1
- luxorasap/ingest/cloud/__init__.py +12 -1
- {luxorasap-0.1.27.dist-info → luxorasap-0.1.28.dist-info}/METADATA +1 -1
- {luxorasap-0.1.27.dist-info → luxorasap-0.1.28.dist-info}/RECORD +7 -7
- {luxorasap-0.1.27.dist-info → luxorasap-0.1.28.dist-info}/WHEEL +0 -0
- {luxorasap-0.1.27.dist-info → luxorasap-0.1.28.dist-info}/entry_points.txt +0 -0
- {luxorasap-0.1.27.dist-info → luxorasap-0.1.28.dist-info}/top_level.txt +0 -0
luxorasap/__init__.py
CHANGED
|
@@ -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.28"
|
|
17
17
|
|
|
18
18
|
# ─── Lazy loader ─────────────────────────────────────────────────
|
|
19
19
|
def __getattr__(name: str) -> ModuleType:
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import pandas as pd
|
|
4
4
|
import datetime as dt
|
|
5
|
+
import numpy as np
|
|
5
6
|
|
|
6
7
|
from luxorasap.utils.storage import BlobParquetClient
|
|
7
8
|
from luxorasap.utils.dataframe import prep_for_save, astype_str_inplace
|
|
@@ -28,6 +29,12 @@ def save_table(
|
|
|
28
29
|
|
|
29
30
|
if 'Last_Updated' not in df.columns:
|
|
30
31
|
df['Last_Updated'] = dt.datetime.now()
|
|
32
|
+
else:
|
|
33
|
+
# usando numpy, vamos substituir NaN ou 'nan' pela data e hora de agora
|
|
34
|
+
df["Last_Updated"] = np.where(((df["Last_Updated"].isna()) | (df["Last_Updated"] == 'nan')),
|
|
35
|
+
dt.datetime.now(),
|
|
36
|
+
df["Last_Updated"]
|
|
37
|
+
)
|
|
31
38
|
|
|
32
39
|
if override == False:
|
|
33
40
|
lq = LuxorQuery()
|
|
@@ -51,7 +58,8 @@ def incremental_load(
|
|
|
51
58
|
index: bool = False,
|
|
52
59
|
index_name: str = "index",
|
|
53
60
|
normalize_columns: bool = True,
|
|
54
|
-
directory: str = "enriched/parquet"
|
|
61
|
+
directory: str = "enriched/parquet",
|
|
62
|
+
unique_columns: list = None
|
|
55
63
|
):
|
|
56
64
|
"""Concatena novos dados aos existentes, cortando duplicados pela data."""
|
|
57
65
|
df["Last_Updated"] = dt.datetime.now()
|
|
@@ -61,6 +69,9 @@ def incremental_load(
|
|
|
61
69
|
cutoff = df[increment_column].max()
|
|
62
70
|
prev = prev.query(f"{increment_column} < @cutoff")
|
|
63
71
|
df = pd.concat([prev, df], ignore_index=True)
|
|
72
|
+
# remover duplicados
|
|
73
|
+
if unique_columns is not None:
|
|
74
|
+
df = df.drop_duplicates(subset=unique_columns, keep='last')
|
|
64
75
|
|
|
65
76
|
save_table(
|
|
66
77
|
table_name,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
luxorasap/__init__.py,sha256=
|
|
1
|
+
luxorasap/__init__.py,sha256=aLdz8hH_gBFzMC-ovvI7-9Od1qgRf6Z1AvNdhpCGLOE,1356
|
|
2
2
|
luxorasap/btgapi/__init__.py,sha256=QUlfb5oiBY6K1Q5x4-a-x2wECe1At5wc2962I5odOJk,620
|
|
3
3
|
luxorasap/btgapi/auth.py,sha256=PvyCtbEyBO2B1CIeAlNXWugKW1OgiKfPcVzS6K5FBnQ,1872
|
|
4
4
|
luxorasap/btgapi/reports.py,sha256=ZVEMLoJPXc0r3XjPJPMsKQN0zZd1Npd7umNpAj1bncs,8040
|
|
@@ -6,7 +6,7 @@ luxorasap/btgapi/trades.py,sha256=956HZ9BvN9C_VQvKTyBLN0x6ZygwVqBZN11F7OnNbDI,59
|
|
|
6
6
|
luxorasap/datareader/__init__.py,sha256=41RAvbrQ4R6oj67S32CrKqolx0CJ2W8cbOF6g5Cqm2g,120
|
|
7
7
|
luxorasap/datareader/core.py,sha256=mNXCHYTK-e-8cyfwwVAkHjgchqIg1WJa4rY1zXPCSR4,156040
|
|
8
8
|
luxorasap/ingest/__init__.py,sha256=XhxDTN2ar-u6UCPhnxNU_to-nWiit-SpQ6cA_N9eMSs,795
|
|
9
|
-
luxorasap/ingest/cloud/__init__.py,sha256=
|
|
9
|
+
luxorasap/ingest/cloud/__init__.py,sha256=x7Ct0VsGh81_vq-XU075P-9QGgS__JWLuWx873TFwxU,2709
|
|
10
10
|
luxorasap/ingest/legacy_local/dataloader.py,sha256=zKPhuiBSFwkuWN6d8g2s60KkbVk1R_1cGMCtQM9j-0c,11908
|
|
11
11
|
luxorasap/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
luxorasap/utils/dataframe/__init__.py,sha256=heKpmq58FmX35syzzwrHqlOWKYBkH2Z1jyqaQ_Vg-00,265
|
|
@@ -14,8 +14,8 @@ luxorasap/utils/dataframe/reader.py,sha256=Vzjdw-AeS1lnWEHQ8RZNh0kK93NWTp0NWVi_B
|
|
|
14
14
|
luxorasap/utils/dataframe/transforms.py,sha256=OIvlTTcjFX6bUhuQp_syEp7ssm4sLzwvgsag6n2Wl3k,2438
|
|
15
15
|
luxorasap/utils/storage/__init__.py,sha256=U3XRq94yzRp3kgBSUcRzs2tQgJ4o8h8a1ZzwiscA5XM,67
|
|
16
16
|
luxorasap/utils/storage/blob.py,sha256=0QnwrUP-9vWYK8ffa6NqE7rV_t6RdScRM8GQnMxY_4w,3184
|
|
17
|
-
luxorasap-0.1.
|
|
18
|
-
luxorasap-0.1.
|
|
19
|
-
luxorasap-0.1.
|
|
20
|
-
luxorasap-0.1.
|
|
21
|
-
luxorasap-0.1.
|
|
17
|
+
luxorasap-0.1.28.dist-info/METADATA,sha256=P-Q0LBkNnFO1QGSIfAmRxd4wABDPJe3vGLAmhrq3Roo,3804
|
|
18
|
+
luxorasap-0.1.28.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
+
luxorasap-0.1.28.dist-info/entry_points.txt,sha256=XFh-dOwUhlya9DmGvgookMI0ezyUJjcOvTIHDEYS44g,52
|
|
20
|
+
luxorasap-0.1.28.dist-info/top_level.txt,sha256=9YOL6bUIpzY06XFBRkUW1e4rgB32Ds91fQPGwUEjxzU,10
|
|
21
|
+
luxorasap-0.1.28.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|