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

issue: Jobs.list_jobs() return value is not JSON #27

Closed
sosadchuk opened this issue Jan 27, 2021 · 3 comments · Fixed by #252
Closed

issue: Jobs.list_jobs() return value is not JSON #27

sosadchuk opened this issue Jan 27, 2021 · 3 comments · Fixed by #252
Assignees
Labels
bug Something isn't working good first issue Good for newcomers priority-low severity-medium

Comments

@sosadchuk
Copy link
Contributor

Hi,

Checked Jobs.list_jobs() method, but I believe this issue spreading more than I will mention here.

list_jobs() dosctring states:

Returns
        -------
        json
            A JSON containing a list of jobs on JES queue based on the given parameters

But in fact the return value is a list, and processing it with json.loads() will lead to exception:

TypeError: the JSON object must be str, bytes or bytearray, not list

Either docstring change needed, or behavior change and encapsulation of response with something like:

return f'{{"response":{response_json}}}'
@gcartier94 gcartier94 self-assigned this Apr 13, 2021
@t1m0thyj t1m0thyj moved this to Low Priority in Zowe CLI Squad Dec 26, 2023
@t1m0thyj t1m0thyj added the good first issue Good for newcomers label Jan 9, 2024
@Myrausman
Copy link
Contributor

@t1m0thyj , I am interested in addressing this issue. Could you please assign it to me?
Also, I'd like to confirm whether I should modify the docstring or the return type of the method.

@Myrausman
Copy link
Contributor

@zFernand0 should i update changelog as well ?

@t1m0thyj
Copy link
Member

@t1m0thyj , I am interested in addressing this issue. Could you please assign it to me? Also, I'd like to confirm whether I should modify the docstring or the return type of the method.

@Myrausman Thanks for contributing and sorry for not replying sooner. I've looked into this and the method is returning a JSON object, so we shouldn't need to import the json package or change any code in the method. We just need to change the doc string to say that it returns a JSON object.

Could you please close #251 and open a new PR that updates the docstrings? For all the places in jobs.py that say A JSON containing, this is a typo and it should say A JSON object containing instead 🙂

should i update changelog as well ?

If your PR only updates docstrings, then no changelog update is required since there are no user-facing changes.

@t1m0thyj t1m0thyj linked a pull request Feb 16, 2024 that will close this issue
4 tasks
@github-project-automation github-project-automation bot moved this from Low Priority to Closed in Zowe CLI Squad Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers priority-low severity-medium
Projects
None yet
5 participants