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

feat(datatable): add remove column method #2899

Conversation

TomJGooding
Copy link
Contributor

@TomJGooding TomJGooding commented Jul 6, 2023

Description

Add a remove_column method to remove individual columns from a DataTable. The code is essentially just a copy of the existing remove_row method, apart from deleting from DataTable._data.

Related Issue

How Has This Been Tested?

The new test simply checks the column length and the row data after a column is removed. This has also been tested manually with a simple app that removes the column under the cursor (as described in the updated docs).

There are currently no snapshot tests. If this is required I'm afraid I may need some guidance!

Checklist:

  • Docstrings on all new or modified functions / classes
  • Updated documentation
  • Updated CHANGELOG.md (where appropriate)

@TomJGooding TomJGooding marked this pull request as draft July 6, 2023 18:26
@TomJGooding TomJGooding changed the title feat(datatable): add remove column method [WiP] feat(datatable): add remove column method Jul 6, 2023
@TomJGooding TomJGooding changed the title [WiP] feat(datatable): add remove column method feat(datatable): add remove column method Jul 6, 2023
@TomJGooding TomJGooding marked this pull request as ready for review July 6, 2023 21:03
@TomJGooding
Copy link
Contributor Author

TomJGooding commented Jul 6, 2023

P.S. I found it a bit difficult to understand the existing remove method through all the red mist in my editor, as mypy really isn't happy! I haven't delved into the code yet but I wonder if this could be improved?

Copy link
Member

@darrenburns darrenburns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@willmcgugan
Copy link
Collaborator

Thanks, Tom!

@willmcgugan willmcgugan merged commit 2d02665 into Textualize:main Jul 12, 2023
@TomJGooding TomJGooding deleted the feat-datatable-add-remove-column-method branch July 12, 2023 10:32
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.

3 participants