Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cln/separate logic from init #58628

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

PedroVerardo
Copy link

@PedroVerardo PedroVerardo commented May 8, 2024

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

I'm new to the project and was trying to contribute in some way.
To do this, I ran some static analysis tools(sonarcube, pylint and flake8).
I am now aiming to improve readability and maintainability by proposing a quality improvement that involves removing code duplication and transforming it into a function.

@attack68
Copy link
Contributor

attack68 commented May 8, 2024

Hi thanks for the suggestion, I will have a think on this. Im not convinced that this really reduces code duplication. You have taken a few one line functions and turned it into more code that still calls one line functions.

There are probably many areas which could benefit from this kind of analysis though, maybe just not here.

@PedroVerardo
Copy link
Author

Hi @attack68, thank you for your reply. I understood what you said. I noticed a pattern of using lambda functions repetitively without treating them as functions in other parts of the pandas code; this is probably more of a code style to simplify things.

The two warning code pylint gave me are C3001 and W0108.

I can define a function to be used during the initialization of the class; this approach might be cleaner than before. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants