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

Bug: Error when trying to filter language to 'csharp' when also using '-d' filter #111

Open
MostHated opened this issue Feb 1, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@MostHated
Copy link

MostHated commented Feb 1, 2022

When filtering results, if using the language csharp on its own, it is fine, but if I add -d today, I get the error seen in the details dropdown below:

Error details

`-l csharp -d today`
zsh  starcli -l csharp -d today 
Traceback (most recent call last):
  File "/home/mosthated/.pyenv/versions/3.9.9/bin/starcli", line 8, in <module>
    sys.exit(cli())
  File "/home/mosthated/.pyenv/versions/3.9.9/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/mosthated/.pyenv/versions/3.9.9/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/mosthated/.pyenv/versions/3.9.9/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/mosthated/.pyenv/versions/3.9.9/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/mosthated/.pyenv/versions/3.9.9/lib/python3.9/site-packages/starcli/__main__.py", line 183, in cli
    tmp_repos = search_github_trending(
  File "/home/mosthated/.pyenv/versions/3.9.9/lib/python3.9/site-packages/starcli/search.py", line 233, in search_github_trending
    gtrending_repo_list = fetch_repos(
  File "/home/mosthated/.pyenv/versions/3.9.9/lib/python3.9/site-packages/gtrending/fetch.py", line 30, in fetch_repos
    raise ValueError(f"Invalid language argument: {language}")
ValueError: Invalid language argument: csharp

This demonstrates it not working, as well as working with the omission of the -d filter

# This works fine:
starcli -l csharp

# This does not
starcli -l csharp -d today

# I also tried a few others, but had the same results
starcli -l csharp -d this-week
starcli --lang csharp -d this-week
starcli -d today -l csharp 
starcli -d this-week -l csharp 

Just to check, I also tried the following, and it worked fine:

starcli -l rust -d today 

Python version
3.9.9

your operating system (and terminal type or shell of needed)

System Details
mosthated@pop-os
----------------
OS: Pop!_OS 21.10 x86_64
Host: X570 AORUS ELITE -CF
Kernel: 5.15.15-76051515-generic
Uptime: 7 days, 16 hours, 39 mins
Packages: 3947 (dpkg), 194 (brew), 76 (flatpak), 13 (snap)
Shell: zsh 5.8
Resolution: 1920x1080, 2560x1080, 1920x1080
DE: GNOME 40.5
WM: Mutter
WM Theme: Materia-dark-compact
Theme: Materia-dark-compact [GTK2/3]
Icons: Flatery-Orange-Dark [GTK2/3]
Terminal: alacritty
CPU: AMD Ryzen 9 3950X (32) @ 3.500GHz
GPU: NVIDIA GeForce RTX 2070
Memory: 53130MiB / 64314MiB

starcli version
starcli==2.17.1

@MostHated MostHated added the bug Something isn't working label Feb 1, 2022
@hedyhli
Copy link
Owner

hedyhli commented Feb 2, 2022

Hi, I think I know what's causing this inconsistent behaviour. I'll get to it as soon as I get the chance, thanks!

@Treehole
Copy link

Treehole commented Feb 9, 2022

Hi, I think I know what's causing this inconsistent behaviour. I'll get to it as soon as I get the chance, thanks!

Hi, hedyhli. I like your project, so I want to work for this project. I check this issue and find the problem is your api(https://gtrend.yapie.me/languages) doesn't update with the language c#/csharp.
If you have no time to do this, I am glad to fix this bug.
Thanks for your Job!

@hedyhli
Copy link
Owner

hedyhli commented Jan 11, 2023

It seems like the GitHub search API uses 'csharp' whereas GitHub Trending uses 'c#'. To have consistency we could change 'csharp' to 'c#' before calling the gtrending functions. Note that it appears there's also inconsistency with 'cpp' vs 'c++', possibly others too. It'd be nice to have all the language parameters for GitHub search work for GitHub Trending as well.

Apologies for the delay @Treehole, are you still interested in working on this?

@CristhianMotoche
Copy link

Hello there! Could I give a try to this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants