Traceback (most recent call last):
File "/workspaces/kloppy/_dev.py", line 3, in <module>
dataset = opta.load(
File "/workspaces/kloppy/kloppy/_providers/opta.py", line 35, in load
return deserializer.deserialize(
File "/workspaces/kloppy/kloppy/infra/serializers/event/opta/deserializer.py", line 729, in deserialize
match_result_type = list(match_result_path.find(f7_root))[
File "src/lxml/objectpath.pxi", line 55, in lxml.objectify.ObjectPath.__call__
File "src/lxml/objectpath.pxi", line 219, in lxml.objectify._find_object_path
AttributeError: no such child: Result
Normally, in a completed game we'd have a Result tag that looks something like this:
<Result Type="Aggregate" Winner="t12345" />
But, because the game is not finished yet there simply is no "Result" tag.
Doing a simple try / except block like below resolves this issue and creates a correct Kloppy EventDataset.
Hi!
A really simple fix here. When loading opta event data (as shown below) for an incomplete f7 (read: during live matches) we get an AttributeError.
Error looks as follows:
Normally, in a completed game we'd have a Result tag that looks something like this:
But, because the game is not finished yet there simply is no "Result" tag.
Doing a simple try / except block like below resolves this issue and creates a correct Kloppy EventDataset.
Not 100% sure if using a try-except block here is the best solution, but it works.