-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Unknown computed column type #5377
Unknown computed column type #5377
Conversation
The computedColumnType 'unknown' does not exist anymore, but might be stored in the database. So we need to take care of this. Fixes jasp-stats/jasp-issues#2517
0f1f0e7
to
8c00755
Compare
CommonData/column.cpp
Outdated
const std::string & rCode = json["rCode"].asString(); | ||
|
||
const std::string & rCode = json["rCode"].asString(), | ||
& codeTypeStr = json["codeType"].asString(); | ||
|
||
computedColumnType codeType = computedColumnType::notComputed; | ||
if (!codeTypeStr.empty()) | ||
{ | ||
try { codeType = computedColumnTypeFromString(codeTypeStr); } | ||
catch(...) {} | ||
} | ||
|
||
try { codeType = computedColumnTypeFromString(codeTypeStr); } catch(...) {} | ||
|
||
setCompColStuff | ||
( | ||
json["invalidated"].asBool(), | ||
computedColumnTypeFromString(json["codeType"].asString()), | ||
codeType, | ||
rCode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You dont need to make changes to column.cpp I think?
Just the change to DatabaseInterface::columnGetComputedInfo
should be enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not quite completely sure that this error could not arise here. For the case, it does not hurt I fimd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but if the changes are not necessary at all why make them?
the question is more, how can This has a rootcause and we need to figure it out how it happened. Also, to expand this workaround it would perhaps be good to check in |
When I open the file in 0.18.1, then I see also a not computed column with an icon telling this is a computed column. So the situation was buggy in 0.18.1. The rcode of this column is also empty. The isComputed column in the database is not needed anymore. So I would just remove it. |
Ok so remove it in
And then remove it from all the functions that expect it... You want this to be a hotfix or a potential place to create more bugs though? ;) |
Hmm by removing isColumn in the database, we have then a downgrade issue: JASP file made in 0.18.3 won't be readable in 0.18.2 or lower... This is not expected for a minor release. So I will let the isColumn in the database. We can remove it in 0.19 |
Exactly, however, you still need to fix the output of that function then. The best thing would be to make sure that if the computedColumnType is "notComputed" the |
the _isColumn property of Column class can be deduced by the codeType property, so remove it from the class. However for downgrade purpose, the isColumn column in the database is kept so that JASP file made in 0.18.3 can be still read in 0.18.2 or 0.18.1.
I have removed the _isColumn property of the Column class, as it can be deduced by the codeType property |
The computedColumnType 'unknown' does not exist anymore, but might be stored in the database. So we need to take care of this.
Fixes jasp-stats/jasp-issues#2517