pylint-dev / pylint-ml

Pylint plugin enhancing code analysis for machine learning and data science
MIT License
1 stars 0 forks source link

add-pandas-dataframe-bool-checker #23

Open PeterHamfelt opened 3 months ago

PeterHamfelt commented 3 months ago

Return the bool of a single element Series or DataFrame. Deprecated since version 2.1.0: bool is deprecated and will be removed in future version of pandas. For Series use pandas.Series.item.

References https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.bool.html

PeterHamfelt commented 3 months ago

@Pierre-Sassoulas Hi Pierre, Is there a way to set up the checker to only flag the use of pandas.DataFrame.bool for pandas versions 2.1.0 and lower? Since this feature is deprecated in 2.1.0, I want to make sure we're only alerting when it's truly relevant. Any insights on how to configure this, possibly through pylint-ml or another approach? Many checkers implemented into pylint-ml will be specific to a library and version.

Pierre-Sassoulas commented 3 months ago

I don't think this is something we do yet but detecting the version of a lib is possible. Maybe something to include in pylint 'core' once it's specified. (A specifier for the lib and version in 'msgs' dict and a check before raising/checking a message ?).

PeterHamfelt commented 3 months ago

That sounds like a great addition. As you mentioned, I am interested in checking:

When creating a checker,

Pierre-Sassoulas commented 3 months ago

Could you create an enchantement issue in pylint with a design proposal, please ?

PeterHamfelt commented 3 months ago

Yes, sure I can do that!