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

Bugfix/fix sqlite holidays and excess data #68

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Chris-May
Copy link

Sqlite

This fixes the issue where the sqlite database was not getting populated by anything other than the base_price table.

In sqlite, an INSERT statement implicitly opens a transaction, which needs to be committed before changes are saved in the database.

I added the commit command to do so and updated the documentation.

Duplicating data on each sqlite connection

Every time the code connects to a sqlite database, it adds the same data to the database.

This is one way to fix that by trying to query the last piece of data expected in the database. If it's there, it returns early. Otherwise it'll run the code to add all the data.

Fix: holidays throw "string has no attribute year"

When a request is for a day pass and has a date, the logic it tries to compare the request's date to the date that comes from the database.

However, when sqlite pulls data out of the database, it's a string. It needs to be converted to a datetime object.

This is one way to fix this issue. I'm very open to other suggestions.

@codecop
Copy link
Collaborator

codecop commented Jan 14, 2024

Thank you.
We also need these changes on with_tests please.
Could you see if you can add to the Github build action and also run tests for Python using SQLLite, so both DB connecivities are tested?

@codecop codecop force-pushed the master branch 4 times, most recently from 65049f2 to 4c7caae Compare June 8, 2024 20:20
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