hopeit.dataframes 0.25.0b7__tar.gz → 0.25.0b9__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.
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/PKG-INFO +3 -4
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/setup.py +1 -2
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/dataframe.py +6 -10
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/serialization/dataset.py +2 -2
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/serialization/files.py +2 -5
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/serialization/settings.py +1 -2
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit.dataframes.egg-info/PKG-INFO +3 -4
- hopeit_dataframes-0.25.0b9/src/hopeit.dataframes.egg-info/requires.txt +6 -0
- hopeit_dataframes-0.25.0b7/src/hopeit.dataframes.egg-info/requires.txt +0 -6
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/README.md +0 -0
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/setup.cfg +0 -0
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/__init__.py +0 -0
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/py.typed +0 -0
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/serialization/__init__.py +0 -0
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/setup/__init__.py +0 -0
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/setup/dataframes.py +0 -0
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit.dataframes.egg-info/SOURCES.txt +0 -0
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit.dataframes.egg-info/dependency_links.txt +0 -0
- {hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit.dataframes.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hopeit.dataframes
|
|
3
|
-
Version: 0.25.
|
|
3
|
+
Version: 0.25.0b9
|
|
4
4
|
Summary: Hopeit Engine Dataframes Toolkit
|
|
5
5
|
Home-page: https://github.com/hopeit-git/hopeit.engine
|
|
6
6
|
Author: Leo Smerling and Pablo Canto
|
|
@@ -13,7 +13,6 @@ Project-URL: GitHub: repo, https://github.com/hopeit-git/hopeit.engine
|
|
|
13
13
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
14
|
Classifier: Intended Audience :: Developers
|
|
15
15
|
Classifier: Programming Language :: Python
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -24,9 +23,9 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
24
23
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
25
24
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
25
|
Classifier: Framework :: AsyncIO
|
|
27
|
-
Requires-Python: >=3.
|
|
26
|
+
Requires-Python: >=3.9
|
|
28
27
|
Description-Content-Type: text/markdown
|
|
29
|
-
Requires-Dist: hopeit.engine[fs-storage]==0.25.
|
|
28
|
+
Requires-Dist: hopeit.engine[fs-storage]==0.25.0b9
|
|
30
29
|
Requires-Dist: pandas
|
|
31
30
|
Requires-Dist: numpy
|
|
32
31
|
Provides-Extra: pyarrow
|
|
@@ -18,7 +18,6 @@ setuptools.setup(
|
|
|
18
18
|
"License :: OSI Approved :: Apache Software License",
|
|
19
19
|
"Intended Audience :: Developers",
|
|
20
20
|
"Programming Language :: Python",
|
|
21
|
-
"Programming Language :: Python :: 3.8",
|
|
22
21
|
"Programming Language :: Python :: 3.9",
|
|
23
22
|
"Programming Language :: Python :: 3.10",
|
|
24
23
|
"Programming Language :: Python :: 3.11",
|
|
@@ -46,7 +45,7 @@ setuptools.setup(
|
|
|
46
45
|
package_data={
|
|
47
46
|
"hopeit.dataframes": ["py.typed"],
|
|
48
47
|
},
|
|
49
|
-
python_requires=">=3.
|
|
48
|
+
python_requires=">=3.9",
|
|
50
49
|
install_requires=[
|
|
51
50
|
f"hopeit.engine[fs-storage]=={version['ENGINE_VERSION']}",
|
|
52
51
|
"pandas",
|
{hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/dataframe.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
2
|
DataFrames type abstractions.
|
|
3
3
|
"""
|
|
4
|
+
|
|
4
5
|
import dataclasses
|
|
5
6
|
from datetime import date, datetime, timezone
|
|
6
7
|
from functools import partial
|
|
@@ -24,7 +25,7 @@ DataFrameT = TypeVar("DataFrameT")
|
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
@dataclasses.dataclass
|
|
27
|
-
class DataFrameMetadata
|
|
28
|
+
class DataFrameMetadata:
|
|
28
29
|
columns: List[str]
|
|
29
30
|
fields: Dict[str, FieldInfo]
|
|
30
31
|
|
|
@@ -68,9 +69,7 @@ class DataFrameMixin(Generic[DataFrameT, DataObject]):
|
|
|
68
69
|
raise NotImplementedError # must use @dataframe decorator # pragma: no cover
|
|
69
70
|
|
|
70
71
|
@staticmethod
|
|
71
|
-
def __init_from_series__(
|
|
72
|
-
self, **series: pd.Series
|
|
73
|
-
): # pylint: disable=bad-staticmethod-argument
|
|
72
|
+
def __init_from_series__(self, **series: pd.Series): # pylint: disable=bad-staticmethod-argument
|
|
74
73
|
df = pd.DataFrame(series)
|
|
75
74
|
df.index.name = None # Removes index name to avoid colisions with series name
|
|
76
75
|
if self.__data_object__["validate"]:
|
|
@@ -106,10 +105,7 @@ class DataFrameMixin(Generic[DataFrameT, DataObject]):
|
|
|
106
105
|
return self._from_df(self.__df[key])
|
|
107
106
|
|
|
108
107
|
def _to_dataobjects(self) -> List[DataObject]:
|
|
109
|
-
return [
|
|
110
|
-
self.DataObject(**fields)
|
|
111
|
-
for fields in self.__df.to_dict(orient="records")
|
|
112
|
-
]
|
|
108
|
+
return [self.DataObject(**fields) for fields in self.__df.to_dict(orient="records")]
|
|
113
109
|
|
|
114
110
|
def event_id(self, *args, **kwargs) -> str:
|
|
115
111
|
return ""
|
|
@@ -153,7 +149,7 @@ def dataframe(
|
|
|
153
149
|
if hasattr(cls, "__annotations__") and hasattr(cls, "__dataclass_fields__"):
|
|
154
150
|
amended_class = type(
|
|
155
151
|
cls.__name__,
|
|
156
|
-
(DataFrameMixin,
|
|
152
|
+
(DataFrameMixin,) + cls.__mro__,
|
|
157
153
|
dict(cls.__dict__),
|
|
158
154
|
)
|
|
159
155
|
setattr(amended_class, "__init__", DataFrameMixin.__init_from_series__)
|
|
@@ -162,7 +158,7 @@ def dataframe(
|
|
|
162
158
|
|
|
163
159
|
def add_dataframe_metadata(cls):
|
|
164
160
|
serialized_fields = {k: (v.annotation, v) for k, v in fields(cls).items()}
|
|
165
|
-
dataobject_type = create_model(cls.__name__+"DataObject", **serialized_fields)
|
|
161
|
+
dataobject_type = create_model(cls.__name__ + "DataObject", **serialized_fields)
|
|
166
162
|
dataobject_type = dataobject(dataobject_type, unsafe=True)
|
|
167
163
|
|
|
168
164
|
setattr(cls, "DataObject", dataobject_type)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
"""Dataset objects definition, used as a result of serialized dataframes
|
|
2
|
-
"""
|
|
1
|
+
"""Dataset objects definition, used as a result of serialized dataframes"""
|
|
3
2
|
|
|
4
3
|
from importlib import import_module
|
|
5
4
|
from typing import Generic, Type, TypeVar
|
|
@@ -13,6 +12,7 @@ DataFrameT = TypeVar("DataFrameT")
|
|
|
13
12
|
@dataclass
|
|
14
13
|
class Dataset(Generic[DataFrameT]):
|
|
15
14
|
"""Persisted representation of a @dataframe object"""
|
|
15
|
+
|
|
16
16
|
protocol: str
|
|
17
17
|
partition_key: str
|
|
18
18
|
key: str
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
"""Support for `@dataframes` serialization to files
|
|
2
|
-
"""
|
|
1
|
+
"""Support for `@dataframes` serialization to files"""
|
|
3
2
|
|
|
4
3
|
import io
|
|
5
4
|
from importlib import import_module
|
|
@@ -59,9 +58,7 @@ class DatasetFileStorage(Generic[DataFrameT]):
|
|
|
59
58
|
async def load(self, dataset: Dataset) -> EventPayloadType:
|
|
60
59
|
"""Loads @dataframe annotated object using Dataset metadata"""
|
|
61
60
|
datatype: Type[DataFrameT] = find_dataframe_type(dataset.datatype)
|
|
62
|
-
data = await self.storage.get_file(
|
|
63
|
-
dataset.key, partition_key=dataset.partition_key
|
|
64
|
-
)
|
|
61
|
+
data = await self.storage.get_file(dataset.key, partition_key=dataset.partition_key)
|
|
65
62
|
if data is None:
|
|
66
63
|
raise FileNotFoundError(dataset.key)
|
|
67
64
|
df = pd.read_parquet(io.BytesIO(data), engine="pyarrow")
|
{hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit.dataframes.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hopeit.dataframes
|
|
3
|
-
Version: 0.25.
|
|
3
|
+
Version: 0.25.0b9
|
|
4
4
|
Summary: Hopeit Engine Dataframes Toolkit
|
|
5
5
|
Home-page: https://github.com/hopeit-git/hopeit.engine
|
|
6
6
|
Author: Leo Smerling and Pablo Canto
|
|
@@ -13,7 +13,6 @@ Project-URL: GitHub: repo, https://github.com/hopeit-git/hopeit.engine
|
|
|
13
13
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
14
|
Classifier: Intended Audience :: Developers
|
|
15
15
|
Classifier: Programming Language :: Python
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -24,9 +23,9 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
24
23
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
25
24
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
25
|
Classifier: Framework :: AsyncIO
|
|
27
|
-
Requires-Python: >=3.
|
|
26
|
+
Requires-Python: >=3.9
|
|
28
27
|
Description-Content-Type: text/markdown
|
|
29
|
-
Requires-Dist: hopeit.engine[fs-storage]==0.25.
|
|
28
|
+
Requires-Dist: hopeit.engine[fs-storage]==0.25.0b9
|
|
30
29
|
Requires-Dist: pandas
|
|
31
30
|
Requires-Dist: numpy
|
|
32
31
|
Provides-Extra: pyarrow
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/setup/__init__.py
RENAMED
|
File without changes
|
{hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit/dataframes/setup/dataframes.py
RENAMED
|
File without changes
|
{hopeit_dataframes-0.25.0b7 → hopeit_dataframes-0.25.0b9}/src/hopeit.dataframes.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|