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

AttributeError: 'Base' object has no attribute 'iterate' #1

Open
j2l opened this issue Jan 9, 2024 · 3 comments
Open

AttributeError: 'Base' object has no attribute 'iterate' #1

j2l opened this issue Jan 9, 2024 · 3 comments

Comments

@j2l
Copy link

j2l commented Jan 9, 2024

Great project!
It's not workign for me though :)

airtable-to-sqlite --personal-access-token patNNNN app2XXXX
2024-01-09 16:21:15,213 INFO:airtable_to_sqlite.main:Fetching base record from Airtable...
2024-01-09 16:21:16,131 INFO:airtable_to_sqlite.main:Fetching schema from Airtable...
100%|█████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 19.03it/s]
2024-01-09 16:21:21,128 INFO:airtable_to_sqlite.main:Adding foreign keys
2024-01-09 16:21:22,047 INFO:airtable_to_sqlite.main:Fetching table data
0it [00:00, ?it/s]2024-01-09 16:21:22,048 INFO:airtable_to_sqlite.schema:Fetching table data for Users from Airtable...
0it [00:00, ?it/s]
Traceback (most recent call last):
  File "/home/pm/.local/bin/airtable-to-sqlite", line 8, in <module>
    sys.exit(airtable_to_sqlite())
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1637, in invoke
    super().invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/pm/.local/lib/python3.10/site-packages/airtable_to_sqlite/cli/__init__.py", line 44, in airtable_to_sqlite
    AirtableBaseToSqlite(personal_access_token, db, base, prefer_ids).run()
  File "/home/pm/.local/lib/python3.10/site-packages/airtable_to_sqlite/main.py", line 66, in run
    self.insert_all_table_data()
  File "/home/pm/.local/lib/python3.10/site-packages/airtable_to_sqlite/main.py", line 203, in insert_all_table_data
    self.insert_table_data(table)
  File "/home/pm/.local/lib/python3.10/site-packages/airtable_to_sqlite/main.py", line 212, in insert_table_data
    for record in tqdm(table_data):
  File "/usr/lib/python3/dist-packages/tqdm/std.py", line 1170, in __iter__
    for obj in iterable:
  File "/home/pm/.local/lib/python3.10/site-packages/airtable_to_sqlite/schema.py", line 112, in get_table_data
    for page in api.iterate(self.name):
AttributeError: 'Base' object has no attribute 'iterate'

Any idea?

@drkane
Copy link
Member

drkane commented Jan 9, 2024

Ah - thanks for reporting.

I think it might have something to do with the changes to pyairtable for the latest version.

I might need to check it works with the latest version and then pin the dependency.

@drkane
Copy link
Member

drkane commented Jan 9, 2024

Should now be fixed in v0.2.1 - let me know how you get on @j2l

@j2l
Copy link
Author

j2l commented Jan 10, 2024

Thank you @drkane for the prompt reply and perfect fix!
It's importing without errors now.

Hmm, looks like linked records are unlinked:
image

Is there an option (at import) to keep the tables and have only m2m tables?
Like:
image

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