Skip to content

fix(gh): list my stars wrong sorting (52 seconds ago) <Francesc Elies> #1110

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

Merged
merged 1 commit into from
May 1, 2025

Conversation

FrancescElies
Copy link
Contributor

@FrancescElies FrancescElies commented May 1, 2025

github stars listing was wrong because humanized date strings were being sorted instead datetime objects.

Ref. #1109 (comment)

@fdncred
Copy link
Contributor

fdncred commented May 1, 2025

Thanks. I'm good with landing this but I wanted to mention also that I've also seen such a thing stream with the generate command. I'm not sure if this works but I had this stashed away to demonstrate what I'm saying. It probably came from someone in our Discord chat.

# Example of how to use generate to grab paginated data from github
def gen_gh [] {
  let PAGE_SIZE = 10

  generate {|page = 1|
    let resp = http get --headers [Authorization <gh pat>] (
    {
      scheme: https,
      host: "api.github.com",
      path: "/repos/nushell/nushell/issues",
      params: {
      page: $page,
      per_page: $PAGE_SIZE
      }
    } | url join)

    if ($resp | length) < $PAGE_SIZE {
      {out: $resp}
    } else {
      {out: $resp, next: ($page + 1)}
    }
  }
}

@fdncred fdncred merged commit 5e732da into nushell:main May 1, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants