-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Handle more human readable number imports #1107
Comments
Marking as "help wanted" and "good first issue" since it should be largely an extension of the work done for the |
@mathemancer may u assign this to me. I would like to work on it. |
@sahilsaini110 Sure, I've assigned it to you. I also updated the issue description to link to the relevant PR with the custom casting code for money, you'll want to emulate that code. |
Thanks, @kgodey for assigning this issue to me. Also, I will go through the pr you have linked and try to fix this issue. |
@sahilsaini110 I wanted to follow up on this issue since it's been a few days and I don't see a PR yet. Please let us know if you need any help or if you are no longer working on the issue. |
Sorry for the late reply I was trying to solve this issue but was unable to understand how to proceed then I got stuck in some other work sorry for the inconvenience I will take care of that from now on. Also if possible I need some guidance for this issue that like how to start and proceed with this. |
@sahilsaini110 The related PR should provide guidance since it implements the same logic for the money data type. If you have a specific question, please ask. If you're confused by this issue (or any other issue), it would be better to instead work on a different issue that you can grasp quickly. That would give you a better idea of the codebase before working on a more complex issue like this one. |
Yes, I think you are right this is a little bit complex issue since it involves lots of files to be changed so I think I have to first become more familiar with the codebase. Also right now I am busy writing the proposal so unable to give that much time to this. |
@sahilsaini110 Thanks for the update, I unassigned you. |
I'd like to work on this one. |
@Jyuart assigned to you, thanks! Feel free to take your time. |
@mathemancer I'm making my way through the code, getting knowledge (#1137 is very useful for this one, thanks).
But the title of the issue still confuses me a bit. Maybe you meant all the numeric types (integer, decimal, etc?) |
@Jyuart "Number" refers to the Mathesar UI type, which is a grouping of all numeric type. Please read this wiki page for more context: https://wiki.mathesar.org/en/engineering/glossary/ui-types |
@kgodey is correct in that all types under So, to enable human readable number imports, changing the function for casting to @kgodey Do we have a use-case for casting directly from |
For inferring the type when importing data, we decided to only do We should allow users to manually cast from
Please make a separate issue if needed. I agree that this issue shouldn't be blocked. |
In Matrix, @Jyuart asked about which number formats should be considered and how to find all possible numeric representations in different locales. I'll respond here... Without grouping separatorsWithout grouping separators, the problem is fairly straightforward because the decimal separators can either be a dot or a comma. With grouping separatorsI did some research and determined that the following five cases should represent all possible locales, when grouping separators are applied:
Notes:
|
Problem
Currently, we only detect a column as a number type if the entries can be cast to a
NUMERIC
using the default PostgreSQL casting functionality. This is a problem in certain locales, and also can't handle numbers with grouping separators (e.g., the,
in1,000.00
).Proposed solution
We should write custom logic to allow handling more strings when casting to number types.
Additional context
The text was updated successfully, but these errors were encountered: