diff --git a/examples/pandas.toml b/examples/pandas.toml index e5370f9a..c61031d4 100644 --- a/examples/pandas.toml +++ b/examples/pandas.toml @@ -4,95 +4,10 @@ logo = 'logo_pandas.png' exec_failure = "fallback" submodules = [] exclude = [ - # "AssertionError" - "pandas._libs.properties.CachedProperty", - "pandas._config.config.CallableDynamicDoc", - "pandas._libs.index.BaseMultiIndexCodesEngine", - "pandas._libs.properties.AxisProperty", - # "ErrorHelper1- - "pandas.core.algorithms.factorize", - "pandas.core.base.IndexOpsMixin.factorize", - # "ErrorNoExec- - "pandas._libs.index.BaseMultiIndexCodesEngine", - # "ErrorNoExec- - "pandas.core.accessor.register_dataframe_accessor", - "pandas.core.accessor.register_index_accessor", - "pandas.core.accessor.register_series_accessor", - "pandas.core.accessor._register_accessor", - "pandas.core.arrays.base.ExtensionArray.take", - # "ErrorNoExec- - "pandas.plotting._core.PlotAccessor.kde", - # "ExecError- - "pandas._libs.index.BaseMultiIndexCodesEngine", - # "ExecError- - "pandas.core.accessor.register_dataframe_accessor", - "pandas.core.accessor.register_index_accessor", - "pandas.core.accessor.register_series_accessor", - "pandas.core.accessor._register_accessor", - "pandas.core.arrays.base.ExtensionArray.take", - # "ExecError- - "pandas.plotting._core.PlotAccessor.kde", - # "NumpydocError- - "pandas._libs.properties.CachedProperty", - "pandas._config.config.CallableDynamicDoc", - "pandas._libs.properties.AxisProperty", - # "NumpydocError- - "pandas.io.pytables.Table", - # "NumpydocError- - "pandas.core.arraylike.array_ufunc", - "pandas.io.formats.info.BaseInfo.render", - "pandas.core.generic.NDFrame.set_axis", - "pandas.core.generic.NDFrame.replace", - "pandas.core.generic.NDFrame.isna", - "pandas.core.generic.NDFrame.isnull", - "pandas.core.generic.NDFrame.notna", - "pandas.core.generic.NDFrame.notnull", - # "ParseDesc- - "pandas._libs.algos.is_monotonic", - "pandas._libs.interval.intervals_to_interval_bounds", - "pandas.core.algorithms.duplicated", - "pandas._libs.tslibs.offsets.shift_month", - "pandas.core.dtypes.cast.astype_array_safe", - "pandas.core.window.expanding.Expanding.apply", - "pandas.core.window.expanding.Expanding.apply", - "pandas.core.window.expanding.Expanding.sum", - "pandas.core.window.expanding.Expanding.max", - "pandas.core.window.expanding.Expanding.min", - "pandas.core.window.expanding.Expanding.mean", - "pandas.core.window.expanding.Expanding.median", - "pandas.core.window.ewm.ExponentialMovingWindow.mean", - "pandas.core.window.rolling.Rolling.apply", - "pandas.core.window.rolling.Rolling.apply", - "pandas.core.window.rolling.Rolling.sum", - "pandas.core.window.rolling.Rolling.max", - "pandas.core.window.rolling.Rolling.min", - "pandas.core.window.rolling.Rolling.mean", - "pandas.core.window.rolling.Rolling.median", - "pandas.core.groupby.generic.DataFrameGroupBy.aggregate", - "pandas.core.groupby.generic.DataFrameGroupBy.transform", - "pandas.core.groupby.generic.SeriesGroupBy.aggregate", - "pandas.core.groupby.generic.SeriesGroupBy.transform", - "pandas.core.groupby.grouper.Grouping", - "pandas.core.internals.blocks.Block.astype", - "pandas.core.internals.blocks.Block.where", - "pandas.io.parsers.base_parser._get_na_values", - "pandas.core.reshape.melt.lreshape", - # "VisitTargetNotImplementedError - "pandas.plotting._core.PlotAccessor.kde", - "pandas.io.gbq.read_gbq", - "pandas.core.frame.DataFrame.to_gbq", - "pandas.core.indexes.base.Index.drop_duplicates", - "pandas.plotting._core.hist_frame", - # "ExecError-": [ - "pandas._testing._io.network", - # "np.bool_" is seen as a reference - "pandas._libs.lib.is_bool_list", - # Imbalanced backticks - "pandas.core.common.pipe" ] [pandas.expected_errors] ValueError = [ - "pandas.io.gbq:read_gbq", gen.py:2041 + "pandas.io.gbq:read_gbq", "pandas.io.pickle:to_pickle", "pandas.core.frame:DataFrame.to_gbq", "pandas.core.generic:NDFrame.to_pickle", diff --git a/papyri/gen.py b/papyri/gen.py index eeb448a5..3c8d0393 100644 --- a/papyri/gen.py +++ b/papyri/gen.py @@ -124,7 +124,7 @@ def __exit__(self, exc_type, exc_val, exc_tb): del self._expected_unseen[self._qa] else: self._errors.setdefault(ename, []).append(self._qa) - self.log.exception(f"Unexpected error (ctxmgr, {self._qa})") + self.log.exception(f"Unexpected error {self._qa}") if not self.config.early_error: return True expecting = self._expected_unseen.get(self._qa, []) @@ -1806,11 +1806,13 @@ def helper_1( Can be any kind of object """ item_docstring: str = target_item.__doc__ + if item_docstring is not None: + item_docstring = dedent_but_first(item_docstring) builtin_function_or_method = type(sum) if isinstance(target_item, ModuleType): api_object = APIObjectInfo( - "module", target_item.__doc__, None, target_item.__name__, qa + "module", item_docstring, None, target_item.__name__, qa ) elif isinstance(target_item, (FunctionType, builtin_function_or_method)): sig: Optional[str] @@ -1822,17 +1824,17 @@ def helper_1( sig = None try: api_object = APIObjectInfo( - "function", target_item.__doc__, sig, target_item.__name__, qa + "function", item_docstring, sig, target_item.__name__, qa ) except Exception as e: raise type(e)(f"For object {qa!r}") elif isinstance(target_item, type): api_object = APIObjectInfo( - "class", target_item.__doc__, None, target_item.__name__, qa + "class", item_docstring, None, target_item.__name__, qa ) else: api_object = APIObjectInfo( - "other", target_item.__doc__, None, target_item.__name__, qa + "other", item_docstring, None, target_item.__name__, qa ) # print_("Other", target_item) # assert False, type(target_item) @@ -1843,7 +1845,7 @@ def helper_1( elif item_docstring is None and isinstance(target_item, ModuleType): item_docstring = """This module has no documentation""" try: - sections = ts.parse(dedent_but_first(item_docstring).encode(), qa) + sections = ts.parse(item_docstring.encode(), qa) except (AssertionError, NotImplementedError) as e: self.log.error("TS could not parse %s, %s", repr(qa), e) raise type(e)(f"from {qa}") from e