Skip to content

lists and dicts can be handled in raise_for_status #1234

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 2 commits into from
Aug 27, 2023
Merged

lists and dicts can be handled in raise_for_status #1234

merged 2 commits into from
Aug 27, 2023

Conversation

Ch3ri0ur
Copy link
Contributor

This should solve #1230.

I tried to straighten out the code a bit.

I am not sure why we checked if the key from .items() is a dict. That is not possible.

tdk = {"hello": "world"}
td = {tdk: "cool it works"}
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: unhashable type: 'dict'

I guess in an earlier version we iterated over a presumed dict and named the variable k(for key) (But in the background it was a list). fc620ae

Then it was modified. But they then stopped iterating over the object but iterated over the items, which are apparently not always present. 4bb337a

I looks like some classic list/dict confusion but in the end I am not sure what possible responses are. Feedback would be appreciated.

I shoehorned a testcases in there to check for this error.

With regards to #1228 . The response I got with that error has the content-type: 'application/json;charset=UTF-8' which he specifically does not trigger for.

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 85.71% and project coverage change: +0.03% 🎉

Comparison is base (fa7415e) 34.43% compared to head (c93ccaf) 34.46%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1234      +/-   ##
==========================================
+ Coverage   34.43%   34.46%   +0.03%     
==========================================
  Files          44       44              
  Lines        8091     8097       +6     
  Branches     1115     1117       +2     
==========================================
+ Hits         2786     2791       +5     
  Misses       5192     5192              
- Partials      113      114       +1     
Files Changed Coverage Δ
atlassian/rest_client.py 67.79% <85.71%> (+0.54%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gonchik gonchik merged commit 920b1b0 into atlassian-api:master Aug 27, 2023
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.

3 participants