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

Rename random decimal to random float #10320

Merged
merged 1 commit into from Sep 12, 2023

Conversation

sholderbach
Copy link
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 deprecation Related to the deprecation of commands naming-things 🚲 🛖 Working towards consistent naming. No bikeshedding brigade please! labels Sep 11, 2023
Copy link
Collaborator

@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
Member

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
Member

amtoine commented Sep 11, 2023

good job with the deprecation message 👌

@sholderbach
Copy link
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
19 checks passed
@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
deprecation Related to the deprecation of commands naming-things 🚲 🛖 Working towards consistent naming. No bikeshedding brigade please!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants