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

Field calculator output preview should use selected type #21706

Open
qgib opened this issue Oct 25, 2015 · 3 comments
Open

Field calculator output preview should use selected type #21706

qgib opened this issue Oct 25, 2015 · 3 comments

Comments

@qgib
Copy link
Contributor

qgib commented Oct 25, 2015

Author Name: Johannes Kroeger (Johannes Kroeger)
Original Redmine Issue: 13672

Redmine category:unknown


The Field Calculator's "Output preview" should show the same format as using the currently selected "Output field type" would result in.

For example if "Output field type" is set to "Whole number (integer)" it should display a "7", not a "7.123456".

This would at least me make less accidental integer columns when I wanted decimals.

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • easy_fix was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Sep 22, 2017

Author Name: Jürgen Fischer (@jef-n)


  • category_id was configured as Unknown

@kannes
Copy link
Contributor

kannes commented Nov 22, 2021

Haha, hello me from 2015.

This obviously also affects total conversion failures, e. g. when the user has an expression that returns strings and uses that on a integer column. They will get all NULLs and wonder what went wrong.

Thinking about this now I am not sure if the preview should actually cast to the destination type or if the dialog should rather detect a mismatch and complain. The preview previews the result of the expression and there the actual return value should be shown. The actual problem arises later, when it is cast into the destination type.

And then you might have an expression that actually returns the correct type for some features and not for others. Phew...

I think, a much better solution to the issue would be warnings after population of the column if a type cast changed a value. But that is probably something far in the providers' functionality and not easily accessible, right?

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

No branches or pull requests

3 participants