We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6fb387 commit 767517eCopy full SHA for 767517e
twarc/expansions.py
@@ -242,6 +242,15 @@ def ensure_flattened(data):
242
log.warning(f"Unable to expand dictionary without includes: {data}")
243
return flatten(data)
244
245
+ # If it's just an object with errors return an empty list
246
+ elif (
247
+ isinstance(data, dict)
248
+ and "data" not in data
249
+ and "includes" not in data
250
+ and "errors" in data
251
+ ):
252
+ return []
253
+
254
# If it's a single response and both "includes" and "data" are missing, it is already flattened
255
elif isinstance(data, dict) and "data" not in data and "includes" not in data:
256
return [data]
0 commit comments