reduce the number of type checking errors
5 unresolved threads
5 unresolved threads
Merge request reports
Activity
Filter activity
changed milestone to %2.6.0
added category: typing label
requested review from @palmb
assigned to @schaefed
378 378 tmp[mask] = value 379 379 except Exception: 380 380 raise ValueError( 381 f"bad mask. cannot use mask of length {len(mask)} on " 382 f"data of length {len(tmp)}" 381 f"attempted to assign sequence of size {len(tmp)} " 382 f"using indexer {mask}" - the value Error is a reraise from above and handle miss matched length, which is not reflected in the message (i think)
- print the whole object, might blow up the error message if we have many entries (eg. list of millions of NaNs)
better approach: move the error-message out of the try-except block:
if is_listlike() and len ~= len: raise ValueErorr('missmatch') try: ... except E: ...
120 120 return data 121 121 122 122 @property 123 def flags(self) -> MutableMapping[str, pd.Series]: 123 def flags(self) -> pd.DataFrame | DictOfSeries: - Comment on lines -123 to +123
i'm not sure about that. We might should stick with MutableMapping and fix the usage of not supported methods/properties (for example all over in the tests) or go with a custom ABC/Type that inherit from MutableMapping and add only really neccessary methods (like
.columns
that are supported on bothpd.Dataframe
andDictOfSeries
)
10 10 outlier-utils==0.0.5 11 11 pyarrow==14.0.2 12 12 pandas==2.1.4 13 pandas-stubs>=2.1.4 206 206 self._data = self._initFromRaw(raw_data, copy) 207 207 208 208 @staticmethod 209 def _initFromRaw(data: Mapping, copy: bool) -> Dict[str, History]: Mapping
is correct here. the only method used ondata
isitems()
, which is provided by mapping [1]
[1] https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes