Skip to content

Commit

Permalink
fix unbound monty_decode
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Dec 6, 2024
1 parent 7763736 commit 374e476
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mp_api/client/mprester.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ def __init__(
endpoint=self.endpoint,
include_user_agent=include_user_agent,
session=self.session,
monty_decode=monty_decode,
use_document_model=use_document_model,
monty_decode=self.monty_decode,
use_document_model=self.use_document_model,
headers=self.headers,
mute_progress_bars=self.mute_progress_bars,
)
Expand All @@ -275,14 +275,14 @@ def __init__(
if len(suffix_split) == 1:
# Disable monty decode on nested data which may give errors
monty_disable = cls in [TaskRester, ProvenanceRester]
monty_decode = False if monty_disable else monty_decode
monty_decode = False if monty_disable else self.monty_decode
rester = cls(
api_key=api_key,
endpoint=self.endpoint,
include_user_agent=include_user_agent,
session=self.session,
monty_decode=monty_decode,
use_document_model=use_document_model,
use_document_model=self.use_document_model,
headers=self.headers,
mute_progress_bars=self.mute_progress_bars,
) # type: BaseRester
Expand All @@ -305,14 +305,14 @@ def __core_custom_getattr(_self, _attr, _rester_map):
if _attr in _rester_map:
cls = _rester_map[_attr]
monty_disable = cls in [TaskRester, ProvenanceRester]
monty_decode = False if monty_disable else monty_decode
monty_decode = False if monty_disable else self.monty_decode
rester = cls(
api_key=api_key,
endpoint=self.endpoint,
include_user_agent=include_user_agent,
session=self.session,
monty_decode=monty_decode,
use_document_model=use_document_model,
use_document_model=self.use_document_model,
headers=self.headers,
mute_progress_bars=self.mute_progress_bars,
) # type: BaseRester
Expand Down

0 comments on commit 374e476

Please sign in to comment.