databio / bedhost

API and UI for BEDbase
http://api.bedbase.org
BSD 2-Clause "Simplified" License
2 stars 0 forks source link

retrieving schemas #70

Closed nsheff closed 11 months ago

nsheff commented 1 year ago

I can't follow the logic in bedhost on how it's getting the schemas it needs from the bbconf object.

This apparently changed with the new pipestat, and so running bedhost is giving me this error:

  File "/home/nsheff/code/bedhost/bedhost/main.py", line 109, in <module>
    from .routers import api, private_api
  File "/home/nsheff/code/bedhost/bedhost/routers/api.py", line 42, in <module>
    names=get_enum_map(bbc, BEDSET_TABLE, "file")  # dictionary of names and values
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/code/bedhost/bedhost/helpers.py", line 378, in get_enum_map
    schema = serve_schema_for_table(bbc=bbc, table_name=table_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/code/bedhost/bedhost/helpers.py", line 244, in serve_schema_for_table
    return table_manager.schema
           ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'schema'

There's a confusing series of nested calls that I can't really understand, that include these calls:

What is this actually doing and why? And how can the new pipestat fill this?

And, since this is incomprehensible to me, could we possible do this in a different way?

nsheff commented 11 months ago

I believe this will become simpler with updates happening in pipestat, specifically: https://github.com/pepkit/pipestat/issues/78