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

Allow stale values requests to be repeated #159

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Vectornaut
Copy link
Collaborator

This addresses issue #154, using the same technique as pull request #127.

This addresses issue numberscope#154, using the same technique as PR numberscope#127.
@katestange
Copy link
Member

When I pull this and flask run, trying the default url http://127.0.0.1:5000/api/get_oeis_values/A000030/50, I get the following error. It works fine with main.

* Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
Press CTRL+C to quit
2024-09-27T19:00:55.909333 Exception on /api/get_oeis_values/A000030/50 [GET]
Traceback (most recent call last):
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 924, in do_execute
    cursor.execute(statement, parameters)
psycopg2.errors.UndefinedColumn: column sequences.values_req_time does not exist
LINE 1: ...refs, sequences.ref_count AS sequences_ref_count, sequences....
                                                             ^


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

Traceback (most recent call last):
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask_cors/extension.py", line 194, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/flaskr/nscope/views.py", line 456, in get_oeis_values
    seq = fetch_values(valid_oeis_id)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/flaskr/nscope/views.py", line 238, in fetch_values
    seq = find_oeis_sequence(oeis_id)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/flaskr/nscope/views.py", line 220, in find_oeis_sequence
    seq = Sequence.get_seq_by_id(oeis_id)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/flaskr/nscope/models.py", line 54, in get_seq_by_id
    ret = self.query.filter_by(id=id).first()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/orm/query.py", line 2728, in first
    return self.limit(1)._iter().first()  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/orm/query.py", line 2827, in _iter
    result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
                                                  ^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2351, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2236, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/orm/context.py", line 293, in orm_execute_statement
    result = conn.execute(
             ^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1418, in execute
    return meth(
           ^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2353, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 924, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column sequences.values_req_time does not exist
LINE 1: ...refs, sequences.ref_count AS sequences_ref_count, sequences....
                                                             ^

[SQL: SELECT sequences.id AS sequences_id, sequences.name AS sequences_name, sequences.shift AS sequences_shift, sequences.values AS sequences_values, sequences.raw_refs AS sequences_raw_refs, sequences.backrefs AS sequences_backrefs, sequences.ref_count AS sequences_ref_count, sequences.values_req_time AS sequences_values_req_time, sequences.meta_req_time AS sequences_meta_req_time, sequences.factors AS sequences_factors 
FROM sequences 
WHERE sequences.id = %(id_1)s 
 LIMIT %(param_1)s]
[parameters: {'id_1': 'A000030', 'param_1': 1}]
(Background on this error at: https://sqlalche.me/e/20/f405)

@katestange
Copy link
Member

I'm guessing this means I need to reset the database as part of this PR, since there's a new column? Trying that.

@katestange
Copy link
Member

Yes, that was my problem, didn't realize I needed to reset database. Working now.

@katestange
Copy link
Member

flask test returns the following:

...... * Serving Flask app 'mock_oeis'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5001
Press CTRL+C to quit
127.0.0.1 - - [27/Sep/2024 19:15:41] "GET /ready HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2024 19:15:41] "GET /A153080/b153080.txt HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2024 19:15:41] "GET /search?q=A153080&fmt=json HTTP/1.1" 200 -
.E * Serving Flask app 'mock_oeis'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5001
Press CTRL+C to quit
127.0.0.1 - - [27/Sep/2024 19:15:42] "GET /ready HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2024 19:15:42] "GET /search?q=A153080&fmt=json HTTP/1.1" 503 -
2024-09-27T19:15:42.329926 request issue                  response=PCBHRVQgL3NlYXJjaD9xPUExNTMwODAmZm10PWpzb24gSFRUUC8xLjENCjwgSG9zdDogbG9jYWxob3N0OjUwMDENCjwgVXNlci1BZ2VudDogcHl0aG9uLXJlcXVlc3RzLzIuMzIuMw0KPCBBY2NlcHQtRW5jb2Rpbmc6IGd6aXAsIGRlZmxhdGUNCjwgQWNjZXB0OiAqLyoNCjwgQ29ubmVjdGlvbjoga2VlcC1hbGl2ZQ0KPCANCg0KPiBIVFRQLzEuMSA1MDMgU0VSVklDRSBVTkFWQUlMQUJMRQ0KPiBTZXJ2ZXI6IFdlcmt6ZXVnLzMuMC4zIFB5dGhvbi8zLjEyLjMNCj4gRGF0ZTogU2F0LCAyOCBTZXAgMjAyNCAwMToxNTo0MiBHTVQNCj4gQ29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9dXRmLTgNCj4gQ29udGVudC1MZW5ndGg6IDExMw0KPiBDb25uZWN0aW9uOiBjbG9zZQ0KPiANCllvdSBhcmUgY3Jhd2xpbmcgdG9vIGZhc3QuICBDb21lIGJhY2sgaW4gYSBmZXcgbWludXRlcy4KTWFpbCBxdWVzdGlvbnMgdG8gbmphc2xvYW5lQGdtYWlsLmNvbSBhbmQgcnNjQHN3dGNoLmNvbS4K tags=['http error']
. * Serving Flask app 'mock_oeis'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5001
Press CTRL+C to quit
127.0.0.1 - - [27/Sep/2024 19:15:42] "GET /ready HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2024 19:15:42] "GET /A153080/b153080.txt HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2024 19:15:42] "GET /search?q=id:A153080&fmt=json HTTP/1.1" 503 -
2024-09-27T19:15:42.802218 request issue                  response=PCBHRVQgL3NlYXJjaD9xPWlkJTNBQTE1MzA4MCZmbXQ9anNvbiBIVFRQLzEuMQ0KPCBIb3N0OiBsb2NhbGhvc3Q6NTAwMQ0KPCBVc2VyLUFnZW50OiBweXRob24tcmVxdWVzdHMvMi4zMi4zDQo8IEFjY2VwdC1FbmNvZGluZzogZ3ppcCwgZGVmbGF0ZQ0KPCBBY2NlcHQ6ICovKg0KPCBDb25uZWN0aW9uOiBrZWVwLWFsaXZlDQo8IA0KDQo+IEhUVFAvMS4xIDUwMyBTRVJWSUNFIFVOQVZBSUxBQkxFDQo+IFNlcnZlcjogV2Vya3pldWcvMy4wLjMgUHl0aG9uLzMuMTIuMw0KPiBEYXRlOiBTYXQsIDI4IFNlcCAyMDI0IDAxOjE1OjQyIEdNVA0KPiBDb250ZW50LVR5cGU6IHRleHQvaHRtbDsgY2hhcnNldD11dGYtOA0KPiBDb250ZW50LUxlbmd0aDogMTEzDQo+IENvbm5lY3Rpb246IGNsb3NlDQo+IA0KWW91IGFyZSBjcmF3bGluZyB0b28gZmFzdC4gIENvbWUgYmFjayBpbiBhIGZldyBtaW51dGVzLgpNYWlsIHF1ZXN0aW9ucyB0byBuamFzbG9hbmVAZ21haWwuY29tIGFuZCByc2NAc3d0Y2guY29tLgo= tags=['http error']
. * Serving Flask app 'mock_oeis'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5001
Press CTRL+C to quit
127.0.0.1 - - [27/Sep/2024 19:15:43] "GET /ready HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2024 19:15:43] "GET /A153080/b153080.txt HTTP/1.1" 503 -
2024-09-27T19:15:43.181065 request issue                  response=PCBHRVQgL0ExNTMwODAvYjE1MzA4MC50eHQgSFRUUC8xLjENCjwgSG9zdDogbG9jYWxob3N0OjUwMDENCjwgVXNlci1BZ2VudDogcHl0aG9uLXJlcXVlc3RzLzIuMzIuMw0KPCBBY2NlcHQtRW5jb2Rpbmc6IGd6aXAsIGRlZmxhdGUNCjwgQWNjZXB0OiAqLyoNCjwgQ29ubmVjdGlvbjoga2VlcC1hbGl2ZQ0KPCANCg0KPiBIVFRQLzEuMSA1MDMgU0VSVklDRSBVTkFWQUlMQUJMRQ0KPiBTZXJ2ZXI6IFdlcmt6ZXVnLzMuMC4zIFB5dGhvbi8zLjEyLjMNCj4gRGF0ZTogU2F0LCAyOCBTZXAgMjAyNCAwMToxNTo0MyBHTVQNCj4gQ29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9dXRmLTgNCj4gQ29udGVudC1MZW5ndGg6IDExMw0KPiBDb25uZWN0aW9uOiBjbG9zZQ0KPiANCllvdSBhcmUgY3Jhd2xpbmcgdG9vIGZhc3QuICBDb21lIGJhY2sgaW4gYSBmZXcgbWludXRlcy4KTWFpbCBxdWVzdGlvbnMgdG8gbmphc2xvYW5lQGdtYWlsLmNvbSBhbmQgcnNjQHN3dGNoLmNvbS4K tags=['http error']
. * Serving Flask app 'mock_oeis'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5001
Press CTRL+C to quit
127.0.0.1 - - [27/Sep/2024 19:15:43] "GET /ready HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2024 19:15:43] "GET /A153080/b153080.txt HTTP/1.1" 503 -
2024-09-27T19:15:43.611096 request issue                  response=PCBHRVQgL0ExNTMwODAvYjE1MzA4MC50eHQgSFRUUC8xLjENCjwgSG9zdDogbG9jYWxob3N0OjUwMDENCjwgVXNlci1BZ2VudDogcHl0aG9uLXJlcXVlc3RzLzIuMzIuMw0KPCBBY2NlcHQtRW5jb2Rpbmc6IGd6aXAsIGRlZmxhdGUNCjwgQWNjZXB0OiAqLyoNCjwgQ29ubmVjdGlvbjoga2VlcC1hbGl2ZQ0KPCANCg0KPiBIVFRQLzEuMSA1MDMgU0VSVklDRSBVTkFWQUlMQUJMRQ0KPiBTZXJ2ZXI6IFdlcmt6ZXVnLzMuMC4zIFB5dGhvbi8zLjEyLjMNCj4gRGF0ZTogU2F0LCAyOCBTZXAgMjAyNCAwMToxNTo0MyBHTVQNCj4gQ29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9dXRmLTgNCj4gQ29udGVudC1MZW5ndGg6IDExMw0KPiBDb25uZWN0aW9uOiBjbG9zZQ0KPiANCllvdSBhcmUgY3Jhd2xpbmcgdG9vIGZhc3QuICBDb21lIGJhY2sgaW4gYSBmZXcgbWludXRlcy4KTWFpbCBxdWVzdGlvbnMgdG8gbmphc2xvYW5lQGdtYWlsLmNvbSBhbmQgcnNjQHN3dGNoLmNvbS4K tags=['http error']
.
======================================================================
ERROR: test_endpoint (flaskr.nscope.test.test_search_oeis.TestSearchOEIS.test_endpoint)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/katestange/data/code/numberscope/backscope/flaskr/nscope/test/abstract_endpoint_test.py", line 92, in test_endpoint
    response = client.get(self.endpoint)
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/werkzeug/test.py", line 1162, in get
    return self.open(*args, **kw)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/testing.py", line 235, in open
    response = super().open(
               ^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/werkzeug/test.py", line 1116, in open
    response_parts = self.run_wsgi_app(request.environ, buffered=buffered)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/werkzeug/test.py", line 988, in run_wsgi_app
    rv = run_wsgi_app(self.application, environ, buffered=buffered)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/werkzeug/test.py", line 1264, in run_wsgi_app
    app_rv = app(environ, start_response)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 1498, in __call__
    return self.wsgi_app(environ, start_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 1476, in wsgi_app
    response = self.handle_exception(e)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/flaskr/nscope/views.py", line 557, in search_oeis
    resultList = search_response['results']
                 ~~~~~~~~~~~~~~~^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str

----------------------------------------------------------------------
Ran 12 tests in 4.354s

FAILED (errors=1)

@katestange
Copy link
Member

The following endpoints return server error (two are shown below from by-hand testing):

http://127.0.0.1:5000/api/get_oeis_metadata/A028444

2024-09-27T19:17:25.590216 Exception on /api/get_oeis_metadata/A028444 [GET]
Traceback (most recent call last):
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask_cors/extension.py", line 194, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/flaskr/nscope/views.py", line 498, in get_oeis_metadata
    seq = fetch_metadata(valid_oeis_id)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/flaskr/nscope/views.py", line 158, in fetch_metadata
    if search_response['results'] != None:
       ~~~~~~~~~~~~~~~^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str

http://127.0.0.1:5000/api/search_oeis/germain

2024-09-27T19:18:45.122714 Exception on /api/search_oeis/germain [GET]
Traceback (most recent call last):
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask_cors/extension.py", line 194, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/.venv/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/katestange/data/code/numberscope/backscope/flaskr/nscope/views.py", line 557, in search_oeis
    resultList = search_response['results']
                 ~~~~~~~~~~~~~~~^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str

@Vectornaut
Copy link
Collaborator Author

Vectornaut commented Oct 8, 2024

The errors that @katestange reported are also happening on main! The cause seems to be a change in the way the OEIS formats JSON search results, as described in #161. When Glen and I first noticed this last week, Glen suggested addressing #161 and then coming back to this PR.

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

Successfully merging this pull request may close these issues.

2 participants