hopeit.dataframes 0.26.0rc4__tar.gz → 0.26.2__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.
Files changed (25) hide show
  1. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/PKG-INFO +4 -4
  2. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/pyproject.toml +3 -3
  3. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/datablocks.py +1 -1
  4. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/dataframe.py +4 -14
  5. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/serialization/dataset.py +3 -1
  6. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit.dataframes.egg-info/PKG-INFO +4 -4
  7. hopeit_dataframes-0.26.2/src/hopeit.dataframes.egg-info/requires.txt +5 -0
  8. hopeit_dataframes-0.26.0rc4/src/hopeit.dataframes.egg-info/requires.txt +0 -5
  9. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/README.md +0 -0
  10. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/setup.cfg +0 -0
  11. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/__init__.py +0 -0
  12. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/py.typed +0 -0
  13. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/serialization/__init__.py +0 -0
  14. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/serialization/files.py +0 -0
  15. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/serialization/protocol.py +0 -0
  16. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/serialization/py.typed +0 -0
  17. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/serialization/settings.py +0 -0
  18. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/setup/__init__.py +0 -0
  19. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/setup/dataframes.py +0 -0
  20. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/setup/py.typed +0 -0
  21. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/setup/register_database.py +0 -0
  22. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit/dataframes/setup/registry.py +0 -0
  23. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit.dataframes.egg-info/SOURCES.txt +0 -0
  24. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit.dataframes.egg-info/dependency_links.txt +0 -0
  25. {hopeit_dataframes-0.26.0rc4 → hopeit_dataframes-0.26.2}/src/hopeit.dataframes.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: hopeit.dataframes
3
- Version: 0.26.0rc4
3
+ Version: 0.26.2
4
4
  Summary: Hopeit Engine Dataframes for Pandas
5
5
  Author-email: Leo Smerling & Pablo Canto <contact@hopeit.com.ar>, Leo Smerling <contact@hopeit.com.ar>, Pablo Canto <contact@hopeit.com.ar>
6
6
  License: Apache 2
@@ -24,8 +24,8 @@ Classifier: Topic :: Internet :: WWW/HTTP
24
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
25
  Classifier: Framework :: AsyncIO
26
26
  Description-Content-Type: text/markdown
27
- Requires-Dist: hopeit.engine>=0.26.0rc4
28
- Requires-Dist: hopeit.fs-storage>=0.26.0rc4
27
+ Requires-Dist: hopeit.engine>=0.26.2
28
+ Requires-Dist: hopeit.fs-storage>=0.26.2
29
29
  Requires-Dist: pandas>=2.2.3
30
30
  Requires-Dist: pyarrow>=19.0.1
31
31
  Requires-Dist: numpy>=1.26.4
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hopeit.dataframes"
7
- version = "0.26.0rc4"
7
+ version = "0.26.2"
8
8
 
9
9
  description = "Hopeit Engine Dataframes for Pandas"
10
10
  dynamic = ["readme"]
11
11
 
12
12
  dependencies = [
13
- "hopeit.engine>=0.26.0rc4",
14
- "hopeit.fs-storage>=0.26.0rc4",
13
+ "hopeit.engine>=0.26.2",
14
+ "hopeit.fs-storage>=0.26.2",
15
15
  "pandas>=2.2.3",
16
16
  "pyarrow>=19.0.1",
17
17
  "numpy>=1.26.4"
@@ -148,7 +148,7 @@ class DataBlocks(Generic[DataBlockType, DataFrameType]):
148
148
  storage = await get_dataset_storage(database_key)
149
149
  result_df = await DataBlocks._load_datablock_df(storage, dataset, field_names, database_key)
150
150
 
151
- # Add missing optional fields using class schema (allows schema evolution)
151
+ # Enfore datatypes and add missing optional fields using class schema (allows schema evolution)
152
152
  cls._adapt_to_schema(datablock, keys, result_df)
153
153
 
154
154
  # Adding constant value fields
@@ -128,12 +128,11 @@ class DataFrameMixin(Generic[DataFrameT, DataObject]):
128
128
  df = pd.DataFrame(series)
129
129
  df.index.name = None # Removes index name to avoid colisions with series name
130
130
  if self.__data_object__["validate"]:
131
- df = pd.DataFrame(self._coerce_datatypes(df))
131
+ self._coerce_datatypes(df)
132
132
  setattr(self, "__df", df[self.__dataframe__.columns])
133
133
 
134
134
  @classmethod
135
135
  def _from_df(cls, df: pd.DataFrame, **series: Any) -> DataFrameT:
136
- df = df if cls.__data_object__["unsafe"] else pd.DataFrame(df)
137
136
  obj = cls(**{**df._series, **series}) # pylint: disable=protected-access
138
137
  return obj # type: ignore
139
138
 
@@ -145,13 +144,6 @@ class DataFrameMixin(Generic[DataFrameT, DataObject]):
145
144
  def _from_dataobjects(cls, items: Iterator[DataObject]) -> DataFrameT:
146
145
  return cls._from_df(pd.DataFrame(Payload.to_obj(item) for item in items)) # type: ignore[misc]
147
146
 
148
- @classmethod
149
- def _from_df_unsafe(cls, df: pd.DataFrame, **series: pd.Series) -> DataFrameT:
150
- for col, values in series.items():
151
- df[col] = values
152
- obj = cls(**df._series) # pylint: disable=protected-access
153
- return obj # type: ignore
154
-
155
147
  @property
156
148
  def _df(self) -> pd.DataFrame:
157
149
  return getattr(self, "__df")
@@ -210,13 +202,11 @@ class DataFrameMixin(Generic[DataFrameT, DataObject]):
210
202
  def _coerce_datatypes(
211
203
  self,
212
204
  df: pd.DataFrame,
213
- ) -> Dict[str, pd.Series]:
214
- return {
215
- name: self.DATATYPE_MAPPING[field.annotation]( # type: ignore[index, operator]
205
+ ) -> None:
206
+ for name, field in self.__dataframe__.fields.items():
207
+ df[name] = self.DATATYPE_MAPPING[field.annotation]( # type: ignore[index, operator]
216
208
  name, self._get_series(df, name, field)
217
209
  )
218
- for name, field in self.__dataframe__.fields.items()
219
- }
220
210
 
221
211
 
222
212
  def dataframe(
@@ -60,7 +60,9 @@ class Dataset(Generic[DataFrameT]):
60
60
 
61
61
  @classmethod
62
62
  async def load(
63
- cls, dataset: "Dataset[DataFrameT]", database_key: Optional[str] = None
63
+ cls,
64
+ dataset: "Dataset[DataFrameT]",
65
+ database_key: Optional[str] = None,
64
66
  ) -> DataFrameT:
65
67
  try:
66
68
  storage = await get_dataset_storage(database_key)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: hopeit.dataframes
3
- Version: 0.26.0rc4
3
+ Version: 0.26.2
4
4
  Summary: Hopeit Engine Dataframes for Pandas
5
5
  Author-email: Leo Smerling & Pablo Canto <contact@hopeit.com.ar>, Leo Smerling <contact@hopeit.com.ar>, Pablo Canto <contact@hopeit.com.ar>
6
6
  License: Apache 2
@@ -24,8 +24,8 @@ Classifier: Topic :: Internet :: WWW/HTTP
24
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
25
  Classifier: Framework :: AsyncIO
26
26
  Description-Content-Type: text/markdown
27
- Requires-Dist: hopeit.engine>=0.26.0rc4
28
- Requires-Dist: hopeit.fs-storage>=0.26.0rc4
27
+ Requires-Dist: hopeit.engine>=0.26.2
28
+ Requires-Dist: hopeit.fs-storage>=0.26.2
29
29
  Requires-Dist: pandas>=2.2.3
30
30
  Requires-Dist: pyarrow>=19.0.1
31
31
  Requires-Dist: numpy>=1.26.4
@@ -0,0 +1,5 @@
1
+ hopeit.engine>=0.26.2
2
+ hopeit.fs-storage>=0.26.2
3
+ pandas>=2.2.3
4
+ pyarrow>=19.0.1
5
+ numpy>=1.26.4
@@ -1,5 +0,0 @@
1
- hopeit.engine>=0.26.0rc4
2
- hopeit.fs-storage>=0.26.0rc4
3
- pandas>=2.2.3
4
- pyarrow>=19.0.1
5
- numpy>=1.26.4