Skip to content

Define a consistent contract for tabular results #26

Closed

Description

@cvigilv

Split out from #24.

Tabular functions currently return KeggTupleList or KeggGenesList, but the meaning and orientation of data varies between methods. Some parsers return vectors of columns while batched methods return vectors of rows. The result types are also not exported even though public functions return them.

Tables.jl should define the table contract so downstream packages can consume results without KEGGAPI.jl depending on DataFrames.jl.

Plan

  • Add Tables.jl as a dependency.
  • Introduce one exported, immutable result type containing request URL metadata and tabular column data.
  • Implement the Tables.jl column-access interface, including Tables.istable, Tables.columnaccess, Tables.columns, and Tables.schema.
  • Give every column a stable, unique Symbol name.
  • Use the same result type for conversion, DDI, list, find, link, and genomic-feature responses.
  • Correct conversion columns to source first and target second, matching KEGG's response order.
  • Support direct downstream conversion such as DataFrame(result).
  • Preserve .data and .colnames temporarily if practical, with a documented deprecation path.
  • Make empty responses valid tables with a known schema.

Tests

  • Check Tables.columntable and Tables.rowtable for every response shape.
  • Check column order, names, lengths, and element types.
  • Cover empty and batched responses.
  • Add a DataFrames.jl interoperability test as a test-only dependency if needed.

This changes the public result contract and may require a breaking release.

Activity

  1. added 3 commits that reference this issue on Sep 13, 2026
    b5c7a57
    6712d8c
    1b22163
  2. cvigilv commented on Sep 17, 2026

    @cvigilv
    CollaboratorAuthor

    Keeping as is currently, thinking on a redesign in the future is worth the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions