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

__apply_query_filters #3

Open
arpie71 opened this issue Aug 14, 2018 · 2 comments
Open

__apply_query_filters #3

arpie71 opened this issue Aug 14, 2018 · 2 comments

Comments

@arpie71
Copy link
Collaborator

arpie71 commented Aug 14, 2018

This function now returns the error "sqlalchemy.exc.UnboundExecutionError: Could not locate a bind configured on SQL expression or this Session" when the query is returned to a specific function. I've replicated the behavior with find_docs_by_date, find_docs_by_country, find_docs_by_topic.

This comes about when filters are added to the SQL query. If I run the queries with the filters individually, each works.

@mnyrop
Copy link
Contributor

mnyrop commented Sep 26, 2018

@arpie71 can you list steps to reproduce?

@arpie71
Copy link
Collaborator Author

arpie71 commented Sep 27, 2018

I ran the following api request: http://127.0.0.1:5001/declass/v0.4/?start_date=1947-01-01&end_date=1950-12-01

I replace lines 1631 of controller.py to this:

            try:
                db_results_objects = session.q.all()    # returns all documents
            except (RuntimeError, TypeError, NameError) as err:
                print(err)
            except exc.UnboundExecutionError as e:
                print(e)
            except:
                print("Unknown error", sys.exc_info()[0])

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