Update internal use of decimal to float (#10333)

# Description
We made the decision that our floating point type should be referred to
as `float` over `decimal`.
Commands were updated by #9979 and #10320

Now make the internal codebase consistent in referring to this data type
as `float`.

Work for #10332

# User-Facing Changes

`decimal` has been removed as a type name/symbol. 

Instead of 
```nushell
def foo [bar: decimal] decimal -> decimal {}
```
use 
```nushell
def foo [bar: float] float -> float {}
```

Potential effect of `SyntaxShape`'s `Display` implementation now also
referring to `float` instead of `decimal`

# Details
- Rename `SyntaxShape::Decimal` to `Float`
- Update `Display for SyntaxShape` to `float`
- Update error message + fn name in dataframe code
- Fix docs in command examples
- Rename tests that are float specific
- Update doccomment on `SyntaxShape`
- Update comment in script

# Tests + Formatting
Updates the names of some tests
This commit is contained in:
Stefan Holderbach
2023-09-13 23:53:55 +02:00
committed by GitHub
parent 5bd7300cd5
commit bbf0b45c59
15 changed files with 48 additions and 63 deletions

View File

@ -31,9 +31,6 @@ pub enum SyntaxShape {
/// A datetime value, eg `2022-02-02` or `2019-10-12T07:20:50.52+00:00`
DateTime,
/// A decimal value, eg `1.0`
Decimal,
/// A directory is allowed
Directory,
@ -52,6 +49,9 @@ pub enum SyntaxShape {
/// A filesize value is allowed, eg `10kb`
Filesize,
/// A floating point value, eg `1.0`
Float,
/// A dotted path to navigate the table (including variable)
FullCellPath,
@ -82,7 +82,7 @@ pub enum SyntaxShape {
/// Nothing
Nothing,
/// Only a numeric (integer or decimal) value is allowed
/// Only a numeric (integer or float) value is allowed
Number,
/// One of a list of possible items, checked in order
@ -137,7 +137,7 @@ impl SyntaxShape {
SyntaxShape::Expression => Type::Any,
SyntaxShape::Filepath => Type::String,
SyntaxShape::Directory => Type::String,
SyntaxShape::Decimal => Type::Float,
SyntaxShape::Float => Type::Float,
SyntaxShape::Filesize => Type::Filesize,
SyntaxShape::FullCellPath => Type::Any,
SyntaxShape::GlobPattern => Type::String,
@ -189,7 +189,7 @@ impl Display for SyntaxShape {
SyntaxShape::Number => write!(f, "number"),
SyntaxShape::Range => write!(f, "range"),
SyntaxShape::Int => write!(f, "int"),
SyntaxShape::Decimal => write!(f, "decimal"),
SyntaxShape::Float => write!(f, "float"),
SyntaxShape::Filepath => write!(f, "path"),
SyntaxShape::Directory => write!(f, "directory"),
SyntaxShape::GlobPattern => write!(f, "glob"),