Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rdata download option not working #204

Open
samuelbharti opened this issue Dec 21, 2023 · 1 comment
Open

rdata download option not working #204

samuelbharti opened this issue Dec 21, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@samuelbharti
Copy link

samuelbharti commented Dec 21, 2023

On web interface https://run.opencravat.org/
The rdata generation option works for example data with 1 default annotator selected but doesn't work if more/all annotators (155) are selected. It throws an error like this:
Screenshot 2023-12-21 at 1 53 35 PM

I'm assuming only certain annotations are supported for rdata currently. Is there are documentation for same?

@kmoad
Copy link
Collaborator

kmoad commented Jan 12, 2024

All annotations should work with rdata reports. This is a bug with the following traceback. It looks like one or more of the annotators is generating data that is difficult to convert to R. We'll work on narrowing down which annoator is the culprit.

root@b59eeb8e513a:/mnt/jobs/[email protected]/240112-182300# oc report input.sqlite -t rdata --debug
Generating rdata report... Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/cravat/cravat_report.py", line 1129, in run_reporter
    response_t = loop.run_until_complete(reporter.run())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nest_asyncio.py", line 99, in run_until_complete
    return f.result()
           ^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/futures.py", line 203, in result
    raise self._exception.with_traceback(self._exception_tb)
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 277, in __step
    result = coro.send(None)
             ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/cravat/cravat_report.py", line 586, in run
    ret = self.end()
          ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/cravat/modules/reporters/rdatareporter/rdatareporter.py", line 91, in end
    pyreadr.write_rdata(self.filename, level_data, df_name=f'{self.filename_prefix}_{level}')
  File "/usr/local/lib/python3.11/site-packages/pyreadr/pyreadr.py", line 155, in write_rdata
    writer.write_r(filename_bytes, file_format, df, df_name, dateformat, datetimeformat, compress)
  File "/usr/local/lib/python3.11/site-packages/pyreadr/_pyreadr_writer.py", line 226, in write_r
    tcol = transform_data(col, pyreadr_types[column], hasmissing[indx], dateformat, datetimeformat)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyreadr/_pyreadr_writer.py", line 144, in transform_data
    if type(pd_series.dtype) is pd.core.dtypes.dtypes.CategoricalDtype:
            ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pandas/core/generic.py", line 6204, in __getattr__
    return object.__getattribute__(self, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'DataFrame' object has no attribute 'dtype'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/cravat/oc.py", line 238, in main
    args.func(args)
  File "/usr/local/lib/python3.11/site-packages/cravat/cravat_report.py", line 1140, in run_reporter
    loop.run_until_complete(reporter.cf.close_db())
                            ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close_db'

@jasminebro jasminebro added the bug Something isn't working label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants