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

Added an option to detect and report on empty columns into delete rows/columns dialog #7216

Conversation

anastasia-mbithe
Copy link
Contributor

This fixes #6883
Hello @rdstern and @shadrackkibet, I added the empty button at the top of the dialog, as well as the two checkboxes as suggested. I also set the functions and the dialog is working properly; I tested with a procurement dataset that had a lot of empty variables. Am working on adding a report in the output window, i.e.. xxx empty variables deleted or rows or both as suggested in the issue.

@shadrackkibet
Copy link
Collaborator

@rdstern should we remove empty columns in the original data frame or we should have it as a separate data frame?

@anastasia-mbithe
Copy link
Contributor Author

Hello @shadrackkibet, I have been researching on something here and still don't know how to implement it.
I want to add a message in the output window after the execution of the remove empty columns /rows dialog. Such that; if the function deletes two empty variables it gives a message in the output window i.e. "2 empty variables deleted" if its 55 then ; " 55 empty variables deleted", if its rows; "55 empty rows deleted" etc
Can you assist me in that?

@shadrackkibet
Copy link
Collaborator

Ann, leave this to me for now. I will alert you when to proceed. I think I understand what you need to complete the task from your explanation. Keep up the good work!

Meanwhile, I suggest you move to another task.

@shadrackkibet
Copy link
Collaborator

@anastasia-mbithe I have now made changes to this PR. You will notice I have added a remove_empty method into the databook. There are two main reasons for this change.

  • The method in the databook allows us to append the resulting data frame into the original data frame because we can work with the data frame "internally" - This means we do not need ucrSave which allows us to save the resulting object separately.
  • It allows us to customize the message we need using cat which we can then capture and print into the output window - loosely speaking.

You can now pull the changes and test them from your end. Feel free to ask any questions or make changes at the dialog level, I didn't look into it much. Let me know if you find any bugs.

@anastasia-mbithe
Copy link
Contributor Author

@shadrackkibet, thank you so much for this, am following the code as well as testing the dialog.
Am wondering what the default state of the checkboxes should be: should they be checked or unchecked or one of them to be checked. I realized after clicking reset, both appear checked, should I change that? and if so to which preferred state?

@shadrackkibet
Copy link
Collaborator

The default for the R function is both checked so I will go with that. @rdstern might have a different opinion.

@anastasia-mbithe
Copy link
Contributor Author

@rdstern you can look at this and also see if you are okay with the checkboxes.

@rdstern
Copy link
Collaborator

rdstern commented Feb 28, 2022

@anastasia-mbithe I can not check yet. When I load your branch it gives an error right at the start, namely:
image

Then it doesn't let me load a data file. Keeps giving that error. Please tell me when I can check. The dialogue looks fine.

@anastasia-mbithe
Copy link
Contributor Author

@rdstern The bug is fixed, check it now.

@shadrackkibet
Copy link
Collaborator

@rdstern please check. I would like to close this one as soon as possible.

Copy link
Collaborator

@rdstern rdstern left a comment

Choose a reason for hiding this comment

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

@anastasia-mbithe @shadrackkibet great. Now seems to work fine.

@shadrackkibet shadrackkibet changed the title Added Empty button in the Prepare>Dataframe>Delete Rows/Columns dialog Added an option to detect and report on empty columns into delete rows/columns dialog Mar 2, 2022
@shadrackkibet shadrackkibet merged commit 2945178 into IDEMSInternational:master Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detecting and possibly deleting empty variables
3 participants