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: 'NoneType' object has no attribute 'split' #7

Open
rainman-ph opened this issue Mar 26, 2019 · 0 comments
Open

AttributeError: 'NoneType' object has no attribute 'split' #7

rainman-ph opened this issue Mar 26, 2019 · 0 comments

Comments

@rainman-ph
Copy link

rainman-ph commented Mar 26, 2019

@lebinh ,

I just installed aq. I encountered several issues

  1. I have to downgrade prompt-toolkit to 1.x just to be able to install it locally for debugging

  2. I encountered an error while running a simple query:
    Then this one showed up:

 select count(*) from ec2_instances
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aq/__init__.py", line 69, in main
    res = execute_query(engine, formatter, parser, query)
  File "/usr/local/lib/python3.7/site-packages/aq/__init__.py", line 82, in execute_query
    columns, rows = engine.execute(parsed_query, metadata)
  File "/usr/local/lib/python3.7/site-packages/aq/engines.py", line 49, in execute
    self.load_tables(query, metadata)
  File "/usr/local/lib/python3.7/site-packages/aq/engines.py", line 64, in load_tables
    self.load_table(table)
  File "/usr/local/lib/python3.7/site-packages/aq/engines.py", line 75, in load_table
    resource_name, collection_name = table.table.split('_', 1)
AttributeError: 'NoneType' object has no attribute 'split'

When the debugging the following line:

File "/usr/local/lib/python3.7/site-packages/aq/__init__.py", line 82, in execute_query
    columns, rows = engine.execute(parsed_query, metadata)

I have these Local Variable:

query: 'SELECT count(*) FROM ec2_instances'
parsed_query: 'SELECT count(*) FROM ec2_instances'
metadata.tables[0]: TableId(database=None, table=None, alias=None)
metadata.tables[0]._fields: ('tables',)
metadata.tables[0][0]._fields: ('database', 'table', 'alias')
metadata.tables[0][0]._fields_defaults: {}

So then when table.table.split('_', 1) is called since table is empty then table.table.split is also null.

Has the parser.parse_query(query) changed and maybe spits out now empty metadata.tables?

Please advise and thanks.

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

1 participant