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

Fix print typo in code block example in README #1066

Merged
merged 1 commit into from
Oct 27, 2022

Conversation

MatthewJohn
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

Codecov Report

Base: 36.04% // Head: 36.04% // No change to project coverage 👍

Coverage data is based on head (acd1c2d) compared to base (b24f7db).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1066   +/-   ##
=======================================
  Coverage   36.04%   36.04%           
=======================================
  Files          38       38           
  Lines        6956     6956           
  Branches     1008     1008           
=======================================
  Hits         2507     2507           
  Misses       4341     4341           
  Partials      108      108           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@martyn-bristow
Copy link
Contributor

martyn-bristow commented Oct 27, 2022

Hello
This is valid python, and not a typo:

>>> pprint(data)
{'expand': 'renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations,customfield_18344.properties,customfield_18345.properties,customfield_18187.properties,customfield_11300.properties,customfield_12600.properties,customfield_10022.requestTypePractice,customfield_17400.properties',
 'fields': {'aggregateprogress': {'percent': 100,
                                  'progress': 38893200,
                                  'total': 38893200},
            'aggregatetimeestimate': None,
            'aggregatetimeoriginalestimate': None,
            'aggregatetimespent': 38893200,
            'assignee': None,
            'attachment': [],
            'comment': {'comments': [],
                        'maxResults': 0,
>>> print(data)
{'expand': 'renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations,customfield_18344.properties,customfield_18345.properties,customfield_18187.properties,customfield_11300.properties,customfield_12600.properties,customfield_10022.requestTypePractice,customfield_17400.properties', 'id
': '138135', 'self': 'https://corelims.atlassian.net/rest/api/2/issue/138135', 'key': 'INT-1', 'fields': {'customfield_18232': None, 'customfield_18111': None, 'customfield_18353': None, 'customfield_18112': None, 'customfield_18233': None, 'customfield_18354': None, 'customfield_18113': None, 'customfield_1823
4```

Using `pprint` better formats the verbose output from jira or another REST API

@gonchik gonchik merged commit 05ba009 into atlassian-api:master Oct 27, 2022
@gonchik
Copy link
Member

gonchik commented Oct 27, 2022

@martyn-bristow Let's merge it.
I think we have to improve our docs :)

@martyn-bristow
Copy link
Contributor

martyn-bristow commented Oct 27, 2022

Sorry @gonchik , please read my comment! This does NOT improve the docs

The mention of pprint in the doc was originally correct. Pretty Print! It formats the json nicely

If you want to see the response in pretty print format JSON....
```from pprint import pprint
# you code here
# and then print using pprint(result) instead of print(result)
pprint(response)

Was correct. Using print will give you a flat structure.

If we want to advocate using only `print` then the lines above do this, and this is now a duplication

@gonchik
Copy link
Member

gonchik commented Oct 28, 2022

@martyn-bristow hm, you know you're totally right.
I made a small mistake :(

@MatthewJohn
Copy link
Contributor Author

Sorry @martyn-bristow, I was skimming too much :( Sorry for causing such a palaver!

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.

4 participants