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

Ingestion only works once #1

Open
bbengfort opened this issue Jul 17, 2014 · 0 comments
Open

Ingestion only works once #1

bbengfort opened this issue Jul 17, 2014 · 0 comments
Labels

Comments

@bbengfort
Copy link
Member

Ingestion works successfully when you ingest it into a blank database (or when you have completely new routes) - but on the second attempt, when there are already routes in the database, ingestion fails.

It appears to have to do with the relationship between the Pickup and the Route objects, but for whatever reason, the lookup table that is being used in the monthly reports manager isn't getting access to the id of the route, even though that database access comes first. This does work on the initial ingestion though.

I'm not really sure what to do, but possible fixes included:

  • Having the monthly report object have access to the database (sigh)
  • Wrapping the ingestion in a autocommit=False

Here is the error:

sqlalchemy.exc.IntegrityError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (IntegrityError) null value in column "route_id" violates not-null constraint
DETAIL:  Failing row contains (1, 2014-03-03, null, 10G760, 31, 23540, 2014-07-17 11:49:52.829963-04, 2014-07-17 11:53:02.458993-04).
'UPDATE pickups SET route_id=%(route_id)s, updated=%(updated)s WHERE pickups.id = %(pickups_id)s' {'route_id': None, 'updated': datetime.datetime(2014, 7, 17, 11, 53, 2, 458993, tzinfo=tzlocal()), 'pickups_id': 1}
@bbengfort bbengfort added the bug label Jul 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant