dkpro / dkpro-cassis

UIMA CAS processing library written in Python
https://pypi.org/project/dkpro-cassis/
Apache License 2.0
85 stars 22 forks source link

AttributeError while serializing CAS with string array inheritance #100

Closed reneverheij closed 4 years ago

reneverheij commented 5 years ago

Call to cas.to_xmi() fails with AttributeError:

Traceback (most recent call last):
  File "c:\Users\x\git\uima_python\python\uima_rest\test\test_ner_service_wex.py", line 22, in test_process
    xmi_out = service.process(xmi_in, tsd)
  File "c:\Users\x\git\uima_python\python\uima_rest\ner_service\NerService.py", line 37, in process
    xmi_string = cas.to_xmi()
  File "C:\Users\x\Anaconda3\envs\uima_rest\lib\site-packages\cassis\cas.py", line 390, in to_xmi
    serializer.serialize(sink, self, pretty_print=pretty_print)
  File "C:\Users\x\Anaconda3\envs\uima_rest\lib\site-packages\cassis\xmi.py", line 257, in serialize
    for fs in sorted(self._find_all_fs(cas), key=lambda a: a.xmiID):
  File "C:\Users\x\Anaconda3\envs\uima_rest\lib\site-packages\cassis\xmi.py", line 297, in _find_all_fs
    if referenced_fs.xmiID not in all_fs:
AttributeError: 'str' object has no attribute 'xmiID'

To Reproduce Steps to reproduce the behavior: Create a CAS based on the attached XMI document and type system descriptor.

Please complete the following information:

testdata.zip

jcklie commented 5 years ago

The problem is that I did not check things extending string arrays when serializing. A fix is underway.

jcklie commented 5 years ago

It should be fixed in master, I might do a release next week.

reneverheij commented 4 years ago

After pulling the master branch, the error has disappeared.

reneverheij commented 4 years ago

Any chance of a release today? I’d really appreciate it.

jcklie commented 4 years ago

I released it.