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

table introspection suggestion #214

Open
AlexandreWonderwalls opened this issue Jun 20, 2023 · 3 comments
Open

table introspection suggestion #214

AlexandreWonderwalls opened this issue Jun 20, 2023 · 3 comments

Comments

@AlexandreWonderwalls
Copy link

Hello, I'm currently looking in the code. And I'm wondering why we don't use "https://api.airtable.com/v0/meta/bases/appXXXX/tables" to get the table structure and define associated fields. I think this is more realable than the current method:

# Attempts introspection by looking at data.
        # This is super not reliable
        # as Airtable removes the key if the value is empty.
        else:
            # This introspects the just first row in the table.
            if peek_rows is None or peek_rows == 1:
                field_values = {
                    k: [v] for k, v in self._table_api.first()["fields"].items()
                }
            # Or peek at specified number of rows

Is there any technical limitation to use the api?

@cancan101
Copy link
Owner

cancan101 commented Jun 20, 2023

The metadata API is 100% the right way to do this. That API was added recently (2022-11-15). The library here should be updated to use that approach instead of any current approaches.

We do need to use personal access tokens or OAuth rather than an Airtable API key to access this API.

@AlexandreWonderwalls
Copy link
Author

Do you think that you will implement the new approach is the in the near future?

@cancan101
Copy link
Owner

I don't have any immediate plans to do this. That being said, I would be more than happy to review any PRs that are put up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants