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

EmptyValues updates should work (also for files from 0.18.1) #5347

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

JorisGoosen
Copy link
Contributor

Make sure changes are updated in database
Also prepare the upgradeDB function in databaseInterface for future changes

I stopped working on the refactor of EmptyValues, thatll be for post-0.18.2
This should at least make empty values per column etc work for files from 0.18.1 (and perhaps more)

Make sure changes are updated in database
Also prepare the upgradeDB function in databaseInterface for future changes
@JorisGoosen JorisGoosen requested a review from boutinb December 12, 2023 14:43
@JorisGoosen JorisGoosen changed the title EmptyValues updates should also work for files from 0.18.1 EmptyValues updates shoul work (also for files from 0.18.1) Dec 12, 2023
@JorisGoosen JorisGoosen changed the title EmptyValues updates shoul work (also for files from 0.18.1) EmptyValues updates should work (also for files from 0.18.1) Dec 12, 2023
@boutinb
Copy link
Contributor

boutinb commented Dec 13, 2023

Could you provide a reproduction path of what this PR solves?
There is indeed an archive version issue you solved. And you just removed a not used column 'emptyValuesJson' in the table column. But I don't see any problem you solved in the empty values handling.

@JorisGoosen
Copy link
Contributor Author

Could you provide a reproduction path of what this PR solves? There is indeed an archive version issue you solved. And you just removed a not used column 'emptyValuesJson' in the table column. But I don't see any problem you solved in the empty values handling.

  • open 0.18.1, open file from data library, save it somewhere
  • build development
  • load aforementioned file
  • add missing values to a column (for instance '1' to contBinom)
  • save file
  • close file and load just saved file
  • look at empty values in contBinom or whatever
  • be amazed at the lack of them

For a bonus, I think it crashes if you try to then set empty values on the column but I might've misremembered.

@JorisGoosen
Copy link
Contributor Author

It also makes sure the database is upgraded at the right moment

When loading a 0.18.1 JASP file, the workspace default values are empty.
They should be set to the preferences empty values as default (since there is no workspace empty values in 0.18.1).
In DataSet::setEmptyValuesJson, there was already an handling to overcome this issue, but as DataSet has no access to the PreferencesModel object, it was depending of setting the _defaultEmptyvalues property just after the DataSet was created. But as DataSet might be deleted and created several times, the _defaultEmptyvalues is not always set. So just make it a static property, so that it just has to be set once.
@boutinb
Copy link
Contributor

boutinb commented Dec 14, 2023

There was still a problem: the workspace empty values are empty when a 0.18.1 JASP file is loaded. I have just added a commit to solve this.

@JorisGoosen
Copy link
Contributor Author

So approved and it can be merged?

@boutinb boutinb merged commit 378be0b into jasp-stats:development Dec 14, 2023
1 check passed
JorisGoosen added a commit that referenced this pull request Jan 2, 2024
* EmptyValues updates should also work for files from 0.18.1

Make sure changes are updated in database
Also prepare the upgradeDB function in databaseInterface for future changes

* Workspace emptyvalues must have default values

When loading a 0.18.1 JASP file, the workspace default values are empty.
They should be set to the preferences empty values as default (since there is no workspace empty values in 0.18.1).
In DataSet::setEmptyValuesJson, there was already an handling to overcome this issue, but as DataSet has no access to the PreferencesModel object, it was depending of setting the _defaultEmptyvalues property just after the DataSet was created. But as DataSet might be deleted and created several times, the _defaultEmptyvalues is not always set. So just make it a static property, so that it just has to be set once.

---------

Co-authored-by: boutinb <[email protected]>
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.

2 participants