Skip to content

Rename random decimal to random float#10320

Merged
sholderbach merged 1 commit intonushell:mainfrom
sholderbach:floating-randomly
Sep 12, 2023
Merged

Rename random decimal to random float#10320
sholderbach merged 1 commit intonushell:mainfrom
sholderbach:floating-randomly

Conversation

@sholderbach
Copy link
Copy Markdown
Member

Description

Similar to #9979

User-Facing Changes

random decimal will now raise a warning and can be removed in an
upcoming release.

New command is named random float

Tests + Formatting

Tests updated and improved.

Similar to nushell#9979

`random decimal` will now raise a warning and can be removed in an
upcoming release.

New command is named `random float`

Tests updated and improved.
@sholderbach sholderbach added category:deprecation Related to the deprecation of commands/features/options naming-things 🚲 🛖 Working towards consistent naming. No bikeshedding brigade please! labels Sep 11, 2023
Copy link
Copy Markdown
Contributor

@fdncred fdncred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sophiajt
Copy link
Copy Markdown
Contributor

We'll also need to update describe I think? I was poking around and there are still a few places in the code we call things "decimal" instead of "float"

@amtoine
Copy link
Copy Markdown
Member

amtoine commented Sep 11, 2023

good job with the deprecation message 👌

@sholderbach
Copy link
Copy Markdown
Member Author

sholderbach commented Sep 11, 2023

We'll also need to update describe I think? I was poking around and there are still a few places in the code we call things "decimal" instead of "float"

  • describe/Type::to_string() is float
  • Parser accepts both decimal and float...
  • to define SyntaxShape::Decimal
  • StyleComputer to map in the config uses the type name so float

@sholderbach sholderbach merged commit d53b0a9 into nushell:main Sep 12, 2023
@sholderbach sholderbach deleted the floating-randomly branch September 12, 2023 11:04
sholderbach added a commit that referenced this pull request Sep 13, 2023
# 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
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
# Description
Similar to nushell#9979

# User-Facing Changes
`random decimal` will now raise a warning and can be removed in an
upcoming release.

New command is named `random float`

# Tests + Formatting
Tests updated and improved.
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
# Description
We made the decision that our floating point type should be referred to
as `float` over `decimal`.
Commands were updated by nushell#9979 and nushell#10320

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

Work for nushell#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:deprecation Related to the deprecation of commands/features/options naming-things 🚲 🛖 Working towards consistent naming. No bikeshedding brigade please!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants