Skip to content

Possible issue with database - colab demo bug? #19

@jzf2101

Description

@jzf2101

In the colab there's a possible issue with the sql database? Thanks!

# Query the databse - which is automatically downloaded - for a list of agents,
# then calculate Elos for the agents based on a subset of trials.
from boardlaw import sql, elos

ags = (sql.agent_query()
        .query('test_nodes == 64'))

# There are a lot of trials, so for speed filter it down to a subset.
# `bee/%` is the main sequence of experimental runs.
trials = (sql.trial_query(9, 'bee/%')
            .query('black_wins + white_wins >= 512')
            .groupby(['black_agent', 'white_agent'])
            .first().reset_index()
            .loc[lambda df: df.black_agent.isin(ags.index)]
            .loc[lambda df: df.white_agent.isin(ags.index)])

ws, gs = elos.symmetrize(trials)
ags_elos = elos.solve(ws, gs)

ags = ags.join(ags_elos, how='inner')

returns

AttributeError                            Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py](https://localhost:8080/#) in execute(self, statement, parameters, execution_options)
   1408         try:
-> 1409             meth = statement._execute_on_connection
   1410         except AttributeError as err:

AttributeError: 'str' object has no attribute '_execute_on_connection'

The above exception was the direct cause of the following exception:

ObjectNotExecutableError                  Traceback (most recent call last)
6 frames
[/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py](https://localhost:8080/#) in execute(self, statement, parameters, execution_options)
   1409             meth = statement._execute_on_connection
   1410         except AttributeError as err:
-> 1411             raise exc.ObjectNotExecutableError(statement) from err
   1412         else:
   1413             return meth(

ObjectNotExecutableError: Not an executable object: 'select * from agents_details'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions