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

"last week at 04:00" | into datetime panics #12651

Closed
Schweber opened this issue Apr 24, 2024 · 4 comments
Closed

"last week at 04:00" | into datetime panics #12651

Schweber opened this issue Apr 24, 2024 · 4 comments
Labels
needs-triage An issue that hasn't had any proper look
Milestone

Comments

@Schweber
Copy link

Schweber commented Apr 24, 2024

Describe the bug

"last week at 04:00" | into datetime                                                                                                    
Error:   × Main thread panicked.
  ├─▶ at /build/nushell-0.92.1-vendor.tar.gz/human-date-parser/src/lib.rs:436:13
  ╰─▶ Tried to convert Week to a weekday, which is not possible. This is a bug.
  help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.

How to reproduce

Run "last week at 04:00" | into datetime

Expected behavior

"last week" could be interpreted as "7 days ago" (without more specific input) or "sometime last week" (with more specific input like "Friday last week").

In any case, nushell should not panic but show an error message if it doesn't understand "last week" or if "last week" without more specific input is deemed too vague and rejected on purpose.

Configuration

key value
version 0.92.1
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.77.1 (7cf61ebde 2024-03-27) (built from a source tarball)
cargo_version cargo 1.77.1
build_time 1980-01-01 00:00:00 +00:00
build_rust_channel release
allocator mimalloc
features default, sqlite, trash, which
installed_plugins
@Schweber Schweber added the needs-triage An issue that hasn't had any proper look label Apr 24, 2024
@Schweber Schweber changed the title "last week at 04:00" | into datetime panicks "last week at 04:00" | into datetime panics Apr 24, 2024
@fdncred
Copy link
Collaborator

fdncred commented Apr 24, 2024

Probably another upstream issue

@horasal
Copy link
Contributor

horasal commented Apr 25, 2024

actually I can't reproduce this panic on latest version

2024-04-25 192354

and the upstream library

2024-04-25

I think it's may be solved at sometime (maybe technologicalMayhem/human-date-parser@e61ab92 )

Could you try the latest version of nushell?

@Schweber
Copy link
Author

I cant' compile it right now because the latest version of nushell requires rustc 1.77.2 or newer and nixos-unstable is presently at 1.77.1.

But i trust your results and close this issue.

@Schweber
Copy link
Author

I guess this #11710 can be closed as well if it checks out

@hustcer hustcer added this to the v0.93.0 milestone Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage An issue that hasn't had any proper look
Projects
None yet
Development

No branches or pull requests

4 participants