The MicrodataExtract() class expects arguments in snake case. However, because get_extract_info() returns the extract definition using the API's camel case conventions, the following lines in get_extract_by_id() end up passing all camel case arguments to **kwargs instead of the appropriate snake case arguments in MicrodataExtract().
extract_def = self.get_extract_info(extract_id, collection)
if "microdata" in BaseExtract._collection_type_to_extract:
extract = MicrodataExtract(**extract_def["extractDefinition"])
For instance, an extract with a non-default data_structure will be reverted to a rectangular-on-P data structure because its value after get_extract_info() is stored in the dataStructure field of the response. Here's a reproducible example:
We should be able to resolve this simply by using extract_from_dict() to convert from the dictionary to an extract object. extract_from_dict() already handles case conversion.
The
MicrodataExtract()
class expects arguments in snake case. However, becauseget_extract_info()
returns the extract definition using the API's camel case conventions, the following lines inget_extract_by_id()
end up passing all camel case arguments to**kwargs
instead of the appropriate snake case arguments inMicrodataExtract()
.For instance, an extract with a non-default
data_structure
will be reverted to a rectangular-on-P data structure because its value afterget_extract_info()
is stored in thedataStructure
field of the response. Here's a reproducible example: