Skip to content

Commit

Permalink
skip invalid field check for suburls
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Dec 20, 2024
1 parent 614a60b commit 88d6b43
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions mp_api/client/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,14 @@ def _query_resource(
if isinstance(fields, str):
fields = [fields]

invalid_fields = [
f for f in fields if f.split(".", 1)[0] not in self.available_fields
]
if invalid_fields:
raise MPRestError(
f"invalid fields requested: {invalid_fields}. Available fields: {self.available_fields}"
)
if not suburl:
invalid_fields = [
f for f in fields if f.split(".", 1)[0] not in self.available_fields
]
if invalid_fields:
raise MPRestError(
f"invalid fields requested: {invalid_fields}. Available fields: {self.available_fields}"
)

criteria["_fields"] = ",".join(fields)

Expand Down

0 comments on commit 88d6b43

Please sign in to comment.