Skip to content

Rename into decimal to into float#9979

Merged
sholderbach merged 4 commits intonushell:mainfrom
sholderbach:floating-through-space
Sep 12, 2023
Merged

Rename into decimal to into float#9979
sholderbach merged 4 commits intonushell:mainfrom
sholderbach:floating-through-space

Conversation

@sholderbach
Copy link
Copy Markdown
Member

@sholderbach sholderbach commented Aug 10, 2023

Description

We keep "into decimal" for a release and warn through a message that it will be removed in 0.86.

All tests are updated to use into float

User-Facing Changes

into decimal raises a deprecation warning, will be removed soon.
Use into float as the new functionally identical command instead.

~/nushell> 2 | into decimal
Error:   × Deprecated command
   ╭─[entry #1:1:1]
 1 │ 2 | into decimal
   ·     ──────┬─────
   ·           ╰── `into decimal` is deprecated and will be removed in 0.86.
   ╰────
  help: Use `into float` instead


2

Tests + Formatting

Updated

@sholderbach sholderbach added the status:needs-core-team-attention An issue than needs the attention of other core-team members label Aug 10, 2023
@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Aug 10, 2023

I think we need to have both into decimal and into float for the next release, warning when into decimal is used. One way of doing this is having two commands with into decimal having an eprintln!("Warning blah") statement.

@amtoine amtoine added the category:deprecation Related to the deprecation of commands/features/options label Aug 11, 2023
@sophiajt
Copy link
Copy Markdown
Contributor

sophiajt commented Sep 3, 2023

Circling back to this, I think more generally we want to move away from decimal to using the term float

Keep `into decimal`.
Add a warning that it will be removed in the `0.86` release
@sholderbach sholderbach force-pushed the floating-through-space branch from 51b83a0 to 0123986 Compare September 11, 2023 13:48
@sholderbach
Copy link
Copy Markdown
Member Author

Gave it the same report_error_new treatment like we had with str replace --string in #10038

~/nushell> 2 | into decimal
Error:   × Deprecated command
   ╭─[entry #1:1:1]
 1 │ 2 | into decimal
   ·     ──────┬─────
   ·           ╰── `into decimal` is deprecated and will be removed in 0.86.
   ╰────
  help: Use `into float` instead


2

@sholderbach sholderbach marked this pull request as ready for review September 11, 2023 13:50
@sholderbach sholderbach added the naming-things 🚲 🛖 Working towards consistent naming. No bikeshedding brigade please! label Sep 11, 2023
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
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.

I like it this move. Makes me wonder if we're using decimal anywhere else improperly.

@sholderbach
Copy link
Copy Markdown
Member Author

Makes me wonder if we're using decimal anywhere else improperly.

You bet, we have random decimal, several bits of internal code that not just refers to the decimal part of the parse, and a SyntaxShape::Decimal

sholderbach and others added 2 commits September 11, 2023 16:03
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
Mention the deprecated state
sholderbach added a commit to sholderbach/nushell that referenced this pull request Sep 11, 2023
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.
@amtoine
Copy link
Copy Markdown
Member

amtoine commented Sep 11, 2023

@sholderbach
if that's ready, maybe we can land it and squeeze it into next release? 😋

@sholderbach sholderbach merged commit 1fb4f9e into nushell:main Sep 12, 2023
sholderbach added a commit that referenced this pull request Sep 12, 2023
# 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.
@sholderbach sholderbach deleted the floating-through-space branch September 12, 2023 11:04
This was referenced Sep 12, 2023
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
amtoine added a commit that referenced this pull request Oct 10, 2023
followup to
- #9979

## ⚠️ wait for just before 0.86 ⚠️

# Description
after deprecation comes removal 😏 

# User-Facing Changes
`into decimal` is removed in favor of `into float`

# Tests + Formatting

# After Submitting
amtoine added a commit that referenced this pull request Oct 10, 2023
followup to
- #9979

## ⚠️ wait for just before 0.86 ⚠️

# Description
after deprecation comes removal 😏 

# User-Facing Changes
`into decimal` is removed in favor of `into float`

# Tests + Formatting

# After Submitting
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
# Description
We keep "into decimal" for a release and warn through a message that it
will be removed in 0.86.

All tests are updated to use `into float`

# User-Facing Changes
`into decimal` raises a deprecation warning, will be removed soon.
Use `into float` as the new functionally identical command instead.

```
~/nushell> 2 | into decimal
Error:   × Deprecated command
   ╭─[entry #1:1:1]
 1 │ 2 | into decimal
   ·     ──────┬─────
   ·           ╰── `into decimal` is deprecated and will be removed in 0.86.
   ╰────
  help: Use `into float` instead


2
```

# Tests + Formatting
Updated

---------

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
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
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
followup to
- nushell#9979

## ⚠️ wait for just before 0.86 ⚠️

# Description
after deprecation comes removal 😏 

# User-Facing Changes
`into decimal` is removed in favor of `into float`

# Tests + Formatting

# After Submitting
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
followup to
- nushell#9979

## ⚠️ wait for just before 0.86 ⚠️

# Description
after deprecation comes removal 😏 

# User-Facing Changes
`into decimal` is removed in favor of `into float`

# Tests + Formatting

# After Submitting
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! status:needs-core-team-attention An issue than needs the attention of other core-team members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants