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

Add primary_table property to Inspector to allow access without indexing #853

Open
3 tasks
NickPapONS opened this issue Jul 14, 2023 · 0 comments
Open
3 tasks

Comments

@NickPapONS
Copy link
Contributor

NickPapONS commented Jul 14, 2023

The primary table of a data set is an object of type TableInspector that can be accessed using the Inspector class, and it is important for functionality like getting the csv url (to get a Pandas dataframe) or accessing the different columns of the data set. However at the moment, the way the primary table is accessed is by indexing the first element of the tables list object that can be accessed from the Inspector.

This is a simple task to make this process more user friendly as it is something that could be done quite often by users of the Inspect API.

  • Add a new primary_table property to the Inspector class that stores the primary (0th index) table from the existing tables list of TableComponent objects.
  • There are several unit tests in the file test_browsers.py that currently access the primary table using list indexing. Change them to instead use the new property you created and ensure the tests still pass as expected. (This file may be called "test_inspectors" if ticket Change Inspect package structure to allow simple Inspector importing #852 has been completed. If this ticket is done first, please rename it to that, as "test_browsers" is outdated.)
  • Update the worked example 3 documentation page (external-docs > docs > guides > inspect-api > example3.md) that shows the retrieval of the primary table from a data set, so it accesses the new property instead of list indexing the tables list. This is done in line 27 and 159.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants