Skip to content

Unit testing #278

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

Open
PySimpleSQL opened this issue Apr 13, 2023 · 5 comments
Open

Unit testing #278

PySimpleSQL opened this issue Apr 13, 2023 · 5 comments

Comments

@PySimpleSQL
Copy link
Owner

As we get closer to moving to code cleanup, I'd like to start adding some unit tests.

I would prefer to use pytest rather than unittest.

@ssweber
Copy link
Collaborator

ssweber commented Apr 13, 2023

Yes, I'd love this. I've never created a test-suite before.

If you create a few, I'll start helping out.

PySimpleSQL added a commit that referenced this issue Apr 13, 2023
Going to try to keep related items in each file.  We will probably need a dataset_test.py, form_test.py, etc...
PySimpleSQL added a commit that referenced this issue Apr 13, 2023
Not perfect yet, but shows the basic concepts of testing for both no failures and expected failures.  I tried to fix things in ProgressAnimate as I went along so that hopefully you can see the correlation between what was being tested, and the fixes that went in to pass the tests.

If you haven't used pytest before, there's a few things to do:
- pip install pytest
- make sure pysimplesql is reachable as a module.  The easiest way is to do a local installation by running `pip -e .` in the pysimplesql root directory
- from the commandline, run `pytest` to run all tests.  Or you can run tests for a specific file, I.e. `pytest progressanimate_test.py`
@PySimpleSQL
Copy link
Owner Author

I think in the long run, any push or merge into master should have a hook to run all unit tests. I'm not sure if we need that level of protection for development, but it's definitely open for discussion

The SQLDriver unit tests will be a monster by the time they are done, including spooling up of docker. I would imagine these tests will end up taking over a minute or so by the time they are done

@ssweber
Copy link
Collaborator

ssweber commented Apr 13, 2023

It'll be a huge improvement from current by-hand testing all the different database examples via forms.

To test dependent handling we'll probably want a testing database/form/docker images that has dependents. Do you have a preference on a sample database? Create our own, or use use Northwind, AdventureWorks, Chinook?

@PySimpleSQL
Copy link
Owner Author

PySimpleSQL commented Apr 13, 2023 via email

@PySimpleSQL
Copy link
Owner Author

PySimpleSQL commented Apr 13, 2023 via email

PySimpleSQL added a commit that referenced this issue Apr 14, 2023
Not perfect yet, but shows the basic concepts of testing for both no failures and expected failures.  I tried to fix things in ProgressAnimate as I went along so that hopefully you can see the correlation between what was being tested, and the fixes that went in to pass the tests.

If you haven't used pytest before, there's a few things to do:
- pip install pytest
- make sure pysimplesql is reachable as a module.  The easiest way is to do a local installation by running `pip -e .` in the pysimplesql root directory
- from the commandline, run `pytest` to run all tests.  Or you can run tests for a specific file, I.e. `pytest progressanimate_test.py`
PySimpleSQL added a commit that referenced this issue Apr 14, 2023
Finished up ProgressAnimate testing file along with improvments to bulletproof ProgressAnimate
PySimpleSQL added a commit that referenced this issue Apr 14, 2023
add a .ruffignore file to ignore the /tests folder
PySimpleSQL added a commit that referenced this issue Apr 14, 2023
Fixed a SIM102 error flagged by ruff.  This commit should also test if the .ruffignore file is working...
PySimpleSQL added a commit that referenced this issue Apr 14, 2023
Ignore another SIM102 error.  This one would be much messier to combine the if statements.

Looks like the .ruggignore is not working either!
PySimpleSQL added a commit that referenced this issue Apr 14, 2023
Ignore another SIM102 error.  This one would be much messier to combine the if statements.

Looks like the .ruffignore is not working either!
PySimpleSQL added a commit that referenced this issue Apr 14, 2023
adding # ruff: noqa to test files
ssweber added a commit that referenced this issue Apr 22, 2023
commit 35f8bf3
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 11:36:03 2023 -0400

    Fixes lastrowid not being returned correctly in duplicate

    Old code was trying to get the lastrowid after the entire list of queries ran, which would return None due to the insert being buried in the list of queries.  We now grab it after the insert runs by chacking if it has been set yet, and if the result has a lastrowid

commit 9628f65
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 11:29:31 2023 -0400

    refs #281 MSAccess fixes

    Small fixes / ruff fixes

commit 3f24c38
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 11:23:28 2023 -0400

    refs #281 MSAccess fixes

    Duplicate now working.  DROP TABLE IF EXISTS does not seem to work reliably through Jackcess, so added a workaround.  The lastrowid was not being returned due to the nature of the executing a list of queries, so grabbed the inserted id after all of the queries were finished.

commit f904950
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 10:26:48 2023 -0400

    refs #281 MSAccess fixes

    Duplicate now mostly working (selects wrong item after duplicate still).  Had to remove quote_table stuff from the driver, as the variable is used in other places that do not expect it to be quoted - it's not needed anyway, as this is specific driver code and not generalized for all SQLDrivers

commit c53caa7
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 09:39:31 2023 -0400

    refs #281 MSAccess fixes

    override insert_record - Jackcess does not like columns set to None

commit 2179061
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 09:26:28 2023 -0400

    refs #281 Pandas integration

    resolved a small merge conflict

commit 3ff3385
Author: PySimpleSQL <[email protected]>
Date:   Thu Apr 20 15:58:42 2023 -0400

    refs #281, Got a little bit of MSAccess working

    Duplicate still broken.  Out of time to look at it for now

commit fc134c3
Merge: 87e9fac 456c5a7
Author: PySimpleSQL <[email protected]>
Date:   Thu Apr 20 15:58:29 2023 -0400

    Merge remote-tracking branch 'origin/pandas' into pandas

    # Conflicts:
    #	pysimplesql/pysimplesql.py

commit 87e9fac
Author: PySimpleSQL <[email protected]>
Date:   Thu Apr 20 15:55:12 2023 -0400

    refs #281, Got a little bit of MSAccess working

    Duplicate still broken.  Out of time to look at it for now

commit 456c5a7
Author: ssweber <[email protected]>
Date:   Thu Apr 20 15:48:17 2023 -0400

    black

commit 3c78b07
Author: ssweber <[email protected]>
Date:   Thu Apr 20 15:47:51 2023 -0400

    Sqlserver conversions

    still need to do sqlserver pk_column... didn't have time to start up docker to test how that get returned

commit a465cd4
Author: ssweber <[email protected]>
Date:   Thu Apr 20 15:43:42 2023 -0400

    More Result.set conversions

    Access has issue with save and duplicate

commit 204842b
Author: PySimpleSQL <[email protected]>
Date:   Thu Apr 20 11:46:07 2023 -0400

    refs #281, Flatfile fixes

    Small fixes to Flatfile driver to work with pandas

commit 2030c32
Author: ssweber <[email protected]>
Date:   Wed Apr 19 16:15:07 2023 -0400

    Safeguard error if query somehow fails

commit e5e1918
Author: ssweber <[email protected]>
Date:   Wed Apr 19 15:39:32 2023 -0400

    Reverting line change

    I think both work correctly, so I'll just keep the one you wrote :)

commit 10427c8
Author: ssweber <[email protected]>
Date:   Wed Apr 19 15:16:26 2023 -0400

    Working mysql/postgres sql drivers

    Also fixed duplicate button always disabled
    Found other places where we needed to look at attrs instead of result.exception

commit 9d86d1b
Author: ssweber <[email protected]>
Date:   Wed Apr 19 13:54:40 2023 -0400

    Update pysimplesql.py

commit b7db10f
Author: ssweber <[email protected]>
Date:   Wed Apr 19 13:53:33 2023 -0400

    Fix for quick_editor, save_record

    Now with updated sqlite driver, this needed to update attrs

commit f26c5b4
Author: ssweber <[email protected]>
Date:   Tue Apr 18 16:47:03 2023 -0400

    Fixed checking for TableHeading

    I think this fixes the quick-editor

commit 6a256a3
Author: ssweber <[email protected]>
Date:   Tue Apr 18 16:23:23 2023 -0400

    Update pysimplesql.py

commit 454a766
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 15:25:14 2023 -0400

    refs #281, set_by_pk improvements

    There were certain situations where set_by_pk would fail if the primary key was not found (like after deleting a virtual record.).  This ensures that an index will be selected even if the pk value is not found

commit 7f159d8
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 15:18:35 2023 -0400

    refs #281, set_by_pk improvements

    There were certain situations where set_by_pk would fail if the primary key was not found (like after deleting a virtual record.).  This ensures that an index will be selected even if the pk value is not found

commit b84643d
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 14:34:25 2023 -0400

    refs #281, Purge virtual working

    DataSet.purge_virtual is now working.  Also added some pandas display options for easier debugging

commit 3ebcd20
Merge: 149bdc7 749c717
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 12:49:42 2023 -0400

    Merge pull request #288

    Moved things from _SortCallbackWrapper to sort

commit 149bdc7
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 12:47:36 2023 -0400

    refs #281, Duplicate record working

     oops, forgot something

commit 749c717
Author: ssweber <[email protected]>
Date:   Tue Apr 18 12:31:24 2023 -0400

    Update pysimplesql.py

commit db4030d
Author: ssweber <[email protected]>
Date:   Tue Apr 18 12:28:07 2023 -0400

    Update pysimplesql.py

commit aa7c8ac
Author: ssweber <[email protected]>
Date:   Tue Apr 18 12:27:04 2023 -0400

    Move from _SortCallbackWrapper to sort

commit 32266f1
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 12:20:38 2023 -0400

    refs #281, Duplicate record working

    Duplicating records working once again

commit 28118ed
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 12:04:34 2023 -0400

    refs #281, Sorting by foreign keys

    Sorting for foreign keys works again.  A temporary column is added that maps the fk to the description column of the parent table, the dataset is sorted on this temporary column, then the temporary column is dropped in place.

commit caa0754
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 11:03:10 2023 -0400

    refs #281, Record search working again

    Searching for records works as expected again

commit ccabe70
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 10:01:56 2023 -0400

    refs #281, Pandas more cleanup

    Cleaned up a lot of the ResultSet references that are no longer valid now that we are working with DataFrames.

    Changed the set_by_pk call to update_elements, otherwise the navigation buttons don't update after sorting

commit 25e5495
Author: ssweber <[email protected]>
Date:   Tue Apr 18 00:19:37 2023 -0400

    fixes navigation buttons being wrong

commit b7f7051
Author: ssweber <[email protected]>
Date:   Tue Apr 18 00:09:37 2023 -0400

    Lots of fixes

    I think this gets us almost all the way there.

    in insert_row, setting the idx is not implemented yet

    Also, ruff is complaining about:
    F405: 'ResultSet' may be undefined ... but I didn't know what to replace that with.

commit a9928e5
Author: ssweber <[email protected]>
Date:   Mon Apr 17 20:36:40 2023 -0400

    small fix

    you're right, somethings still borked with sorting.

    sorry, this at least gets it in a workable state.

commit 50e7430
Author: ssweber <[email protected]>
Date:   Mon Apr 17 17:08:48 2023 -0400

    fixes

commit 76b4835
Author: PySimpleSQL <[email protected]>
Date:   Mon Apr 17 15:48:42 2023 -0400

    refs #281, Pandas partially working

    Pretty big step backwards with this one. Working on cleaning up the sorting code had some unexpected consequences.  I'm out of time for a while, so checking this in for now

commit 0a77f5e
Author: PySimpleSQL <[email protected]>
Date:   Mon Apr 17 12:43:31 2023 -0400

    refs #281, Pandas partially working

    Sorting code working.  Still need to work out how to sort FK relationships by their description column

commit e3e50eb
Author: PySimpleSQL <[email protected]>
Date:   Mon Apr 17 11:04:31 2023 -0400

    refs #281, Pandas partially working

    Sorting code moved into DataSet.  Still some work to do, but very close to being functional again

commit a529690
Author: PySimpleSQL <[email protected]>
Date:   Mon Apr 17 08:09:36 2023 -0400

    refs #281, Pandas partially working

    Worked towards getting rid of ResultSet entirely and having SQLDriver.execute() returning DataFrames directly with the appropriate attrs set

commit c6a8983
Author: PySimpleSQL <[email protected]>
Date:   Sun Apr 16 19:30:53 2023 -0400

    refs #281 Pandas integration

    A little closer now.  New records insert and mark as virtual.  There was an issue with using .applymap on DataSet.rows, as .applymap returns a Dataset object directly, which was overwriting the ResultSet object.  This fixes that issue.

    Still more to go, but another step closer

commit 0cb39be
Author: ssweber <[email protected]>
Date:   Sun Apr 16 15:12:18 2023 -0400

    Properly insert series back into dataframe

    This fixes it adding that extra column.

commit d1f11bd
Author: PySimpleSQL <[email protected]>
Date:   Sun Apr 16 08:15:41 2023 -0400

    refs #281, Pandas partially working

    More cleanup and experimentation.  There is an issue with saving where sometimes the dict gets an extra key "0" and the update query fails.  Also, even at times that the query goes through, the DataSet does not seem to update immediately to show the difference

commit 0cc1f13
Author: PySimpleSQL <[email protected]>
Date:   Sat Apr 15 20:09:17 2023 -0400

    refs #281, Pandas partially working

    More cleanup

commit bf017ab
Author: PySimpleSQL <[email protected]>
Date:   Sat Apr 15 18:02:33 2023 -0400

    refs #281, Pandas partially working

    Lots of cleanup to do yet!

commit 97e3686
Author: PySimpleSQL <[email protected]>
Date:   Sat Apr 15 16:00:21 2023 -0400

    refs #281, getting a start on converting over to Pandas for ResultSets

    more conversions

commit e9e9190
Merge: 70171b6 dedb62a
Author: PySimpleSQL <[email protected]>
Date:   Sat Apr 15 15:07:02 2023 -0400

    Merge branch 'pytest' into pandas

commit dedb62a
Merge: d494d67 d29cfc0
Author: PySimpleSQL <[email protected]>
Date:   Sat Apr 15 15:05:30 2023 -0400

    Merge branch 'development' into pytest

    # Conflicts:
    #	pysimplesql/pysimplesql.py

commit 70171b6
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 04:25:15 2023 -0400

    refs #281, getting a start on converting over to Pandas for ResultSets

    Got it pretty close to working (at least for the sqlite driver).  More debugging and troubleshooting to go!

commit d494d67
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:47:23 2023 -0400

    refs #278 fix ruff errors

    adding # ruff: noqa to test files

commit cfd3fd7
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:38:08 2023 -0400

    refs #278 fix ruff error

    Ignore another SIM102 error.  This one would be much messier to combine the if statements.

    Looks like the .ruffignore is not working either!

commit f66000c
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:35:41 2023 -0400

    refs #278 fix ruff error

    Ignore another SIM102 error.  This one would be much messier to combine the if statements.

    Looks like the .ruggignore is not working either!

commit d504891
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:31:29 2023 -0400

    refs #278 fix ruff error

    Fixed a SIM102 error flagged by ruff.  This commit should also test if the .ruffignore file is working...

commit 8191b8f
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:25:21 2023 -0400

    refs #278 Unit Tests ruff ignore

    add a .ruffignore file to ignore the /tests folder

commit 61fc8ec
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:21:17 2023 -0400

    refs #278 Unit Test example for ProgressAnimate

    Finished up ProgressAnimate testing file along with improvments to bulletproof ProgressAnimate

commit 7a97927
Merge: 65239d9 2d6938f
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 00:23:56 2023 -0400

    refs #278 Unit Test example for ProgressAnimate

    Not perfect yet, but shows the basic concepts of testing for both no failures and expected failures.  I tried to fix things in ProgressAnimate as I went along so that hopefully you can see the correlation between what was being tested, and the fixes that went in to pass the tests.

    If you haven't used pytest before, there's a few things to do:
    - pip install pytest
    - make sure pysimplesql is reachable as a module.  The easiest way is to do a local installation by running `pip -e .` in the pysimplesql root directory
    - from the commandline, run `pytest` to run all tests.  Or you can run tests for a specific file, I.e. `pytest progressanimate_test.py`
ssweber added a commit that referenced this issue Apr 25, 2023
commit 35f8bf3
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 11:36:03 2023 -0400

    Fixes lastrowid not being returned correctly in duplicate

    Old code was trying to get the lastrowid after the entire list of queries ran, which would return None due to the insert being buried in the list of queries.  We now grab it after the insert runs by chacking if it has been set yet, and if the result has a lastrowid

commit 9628f65
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 11:29:31 2023 -0400

    refs #281 MSAccess fixes

    Small fixes / ruff fixes

commit 3f24c38
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 11:23:28 2023 -0400

    refs #281 MSAccess fixes

    Duplicate now working.  DROP TABLE IF EXISTS does not seem to work reliably through Jackcess, so added a workaround.  The lastrowid was not being returned due to the nature of the executing a list of queries, so grabbed the inserted id after all of the queries were finished.

commit f904950
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 10:26:48 2023 -0400

    refs #281 MSAccess fixes

    Duplicate now mostly working (selects wrong item after duplicate still).  Had to remove quote_table stuff from the driver, as the variable is used in other places that do not expect it to be quoted - it's not needed anyway, as this is specific driver code and not generalized for all SQLDrivers

commit c53caa7
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 09:39:31 2023 -0400

    refs #281 MSAccess fixes

    override insert_record - Jackcess does not like columns set to None

commit 2179061
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 21 09:26:28 2023 -0400

    refs #281 Pandas integration

    resolved a small merge conflict

commit 3ff3385
Author: PySimpleSQL <[email protected]>
Date:   Thu Apr 20 15:58:42 2023 -0400

    refs #281, Got a little bit of MSAccess working

    Duplicate still broken.  Out of time to look at it for now

commit fc134c3
Merge: 87e9fac 456c5a7
Author: PySimpleSQL <[email protected]>
Date:   Thu Apr 20 15:58:29 2023 -0400

    Merge remote-tracking branch 'origin/pandas' into pandas

    # Conflicts:
    #	pysimplesql/pysimplesql.py

commit 87e9fac
Author: PySimpleSQL <[email protected]>
Date:   Thu Apr 20 15:55:12 2023 -0400

    refs #281, Got a little bit of MSAccess working

    Duplicate still broken.  Out of time to look at it for now

commit 456c5a7
Author: ssweber <[email protected]>
Date:   Thu Apr 20 15:48:17 2023 -0400

    black

commit 3c78b07
Author: ssweber <[email protected]>
Date:   Thu Apr 20 15:47:51 2023 -0400

    Sqlserver conversions

    still need to do sqlserver pk_column... didn't have time to start up docker to test how that get returned

commit a465cd4
Author: ssweber <[email protected]>
Date:   Thu Apr 20 15:43:42 2023 -0400

    More Result.set conversions

    Access has issue with save and duplicate

commit 204842b
Author: PySimpleSQL <[email protected]>
Date:   Thu Apr 20 11:46:07 2023 -0400

    refs #281, Flatfile fixes

    Small fixes to Flatfile driver to work with pandas

commit 2030c32
Author: ssweber <[email protected]>
Date:   Wed Apr 19 16:15:07 2023 -0400

    Safeguard error if query somehow fails

commit e5e1918
Author: ssweber <[email protected]>
Date:   Wed Apr 19 15:39:32 2023 -0400

    Reverting line change

    I think both work correctly, so I'll just keep the one you wrote :)

commit 10427c8
Author: ssweber <[email protected]>
Date:   Wed Apr 19 15:16:26 2023 -0400

    Working mysql/postgres sql drivers

    Also fixed duplicate button always disabled
    Found other places where we needed to look at attrs instead of result.exception

commit 9d86d1b
Author: ssweber <[email protected]>
Date:   Wed Apr 19 13:54:40 2023 -0400

    Update pysimplesql.py

commit b7db10f
Author: ssweber <[email protected]>
Date:   Wed Apr 19 13:53:33 2023 -0400

    Fix for quick_editor, save_record

    Now with updated sqlite driver, this needed to update attrs

commit f26c5b4
Author: ssweber <[email protected]>
Date:   Tue Apr 18 16:47:03 2023 -0400

    Fixed checking for TableHeading

    I think this fixes the quick-editor

commit 6a256a3
Author: ssweber <[email protected]>
Date:   Tue Apr 18 16:23:23 2023 -0400

    Update pysimplesql.py

commit 454a766
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 15:25:14 2023 -0400

    refs #281, set_by_pk improvements

    There were certain situations where set_by_pk would fail if the primary key was not found (like after deleting a virtual record.).  This ensures that an index will be selected even if the pk value is not found

commit 7f159d8
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 15:18:35 2023 -0400

    refs #281, set_by_pk improvements

    There were certain situations where set_by_pk would fail if the primary key was not found (like after deleting a virtual record.).  This ensures that an index will be selected even if the pk value is not found

commit b84643d
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 14:34:25 2023 -0400

    refs #281, Purge virtual working

    DataSet.purge_virtual is now working.  Also added some pandas display options for easier debugging

commit 3ebcd20
Merge: 149bdc7 749c717
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 12:49:42 2023 -0400

    Merge pull request #288

    Moved things from _SortCallbackWrapper to sort

commit 149bdc7
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 12:47:36 2023 -0400

    refs #281, Duplicate record working

     oops, forgot something

commit 749c717
Author: ssweber <[email protected]>
Date:   Tue Apr 18 12:31:24 2023 -0400

    Update pysimplesql.py

commit db4030d
Author: ssweber <[email protected]>
Date:   Tue Apr 18 12:28:07 2023 -0400

    Update pysimplesql.py

commit aa7c8ac
Author: ssweber <[email protected]>
Date:   Tue Apr 18 12:27:04 2023 -0400

    Move from _SortCallbackWrapper to sort

commit 32266f1
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 12:20:38 2023 -0400

    refs #281, Duplicate record working

    Duplicating records working once again

commit 28118ed
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 12:04:34 2023 -0400

    refs #281, Sorting by foreign keys

    Sorting for foreign keys works again.  A temporary column is added that maps the fk to the description column of the parent table, the dataset is sorted on this temporary column, then the temporary column is dropped in place.

commit caa0754
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 11:03:10 2023 -0400

    refs #281, Record search working again

    Searching for records works as expected again

commit ccabe70
Author: PySimpleSQL <[email protected]>
Date:   Tue Apr 18 10:01:56 2023 -0400

    refs #281, Pandas more cleanup

    Cleaned up a lot of the ResultSet references that are no longer valid now that we are working with DataFrames.

    Changed the set_by_pk call to update_elements, otherwise the navigation buttons don't update after sorting

commit 25e5495
Author: ssweber <[email protected]>
Date:   Tue Apr 18 00:19:37 2023 -0400

    fixes navigation buttons being wrong

commit b7f7051
Author: ssweber <[email protected]>
Date:   Tue Apr 18 00:09:37 2023 -0400

    Lots of fixes

    I think this gets us almost all the way there.

    in insert_row, setting the idx is not implemented yet

    Also, ruff is complaining about:
    F405: 'ResultSet' may be undefined ... but I didn't know what to replace that with.

commit a9928e5
Author: ssweber <[email protected]>
Date:   Mon Apr 17 20:36:40 2023 -0400

    small fix

    you're right, somethings still borked with sorting.

    sorry, this at least gets it in a workable state.

commit 50e7430
Author: ssweber <[email protected]>
Date:   Mon Apr 17 17:08:48 2023 -0400

    fixes

commit 76b4835
Author: PySimpleSQL <[email protected]>
Date:   Mon Apr 17 15:48:42 2023 -0400

    refs #281, Pandas partially working

    Pretty big step backwards with this one. Working on cleaning up the sorting code had some unexpected consequences.  I'm out of time for a while, so checking this in for now

commit 0a77f5e
Author: PySimpleSQL <[email protected]>
Date:   Mon Apr 17 12:43:31 2023 -0400

    refs #281, Pandas partially working

    Sorting code working.  Still need to work out how to sort FK relationships by their description column

commit e3e50eb
Author: PySimpleSQL <[email protected]>
Date:   Mon Apr 17 11:04:31 2023 -0400

    refs #281, Pandas partially working

    Sorting code moved into DataSet.  Still some work to do, but very close to being functional again

commit a529690
Author: PySimpleSQL <[email protected]>
Date:   Mon Apr 17 08:09:36 2023 -0400

    refs #281, Pandas partially working

    Worked towards getting rid of ResultSet entirely and having SQLDriver.execute() returning DataFrames directly with the appropriate attrs set

commit c6a8983
Author: PySimpleSQL <[email protected]>
Date:   Sun Apr 16 19:30:53 2023 -0400

    refs #281 Pandas integration

    A little closer now.  New records insert and mark as virtual.  There was an issue with using .applymap on DataSet.rows, as .applymap returns a Dataset object directly, which was overwriting the ResultSet object.  This fixes that issue.

    Still more to go, but another step closer

commit 0cb39be
Author: ssweber <[email protected]>
Date:   Sun Apr 16 15:12:18 2023 -0400

    Properly insert series back into dataframe

    This fixes it adding that extra column.

commit d1f11bd
Author: PySimpleSQL <[email protected]>
Date:   Sun Apr 16 08:15:41 2023 -0400

    refs #281, Pandas partially working

    More cleanup and experimentation.  There is an issue with saving where sometimes the dict gets an extra key "0" and the update query fails.  Also, even at times that the query goes through, the DataSet does not seem to update immediately to show the difference

commit 0cc1f13
Author: PySimpleSQL <[email protected]>
Date:   Sat Apr 15 20:09:17 2023 -0400

    refs #281, Pandas partially working

    More cleanup

commit bf017ab
Author: PySimpleSQL <[email protected]>
Date:   Sat Apr 15 18:02:33 2023 -0400

    refs #281, Pandas partially working

    Lots of cleanup to do yet!

commit 97e3686
Author: PySimpleSQL <[email protected]>
Date:   Sat Apr 15 16:00:21 2023 -0400

    refs #281, getting a start on converting over to Pandas for ResultSets

    more conversions

commit e9e9190
Merge: 70171b6 dedb62a
Author: PySimpleSQL <[email protected]>
Date:   Sat Apr 15 15:07:02 2023 -0400

    Merge branch 'pytest' into pandas

commit dedb62a
Merge: d494d67 d29cfc0
Author: PySimpleSQL <[email protected]>
Date:   Sat Apr 15 15:05:30 2023 -0400

    Merge branch 'development' into pytest

    # Conflicts:
    #	pysimplesql/pysimplesql.py

commit 70171b6
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 04:25:15 2023 -0400

    refs #281, getting a start on converting over to Pandas for ResultSets

    Got it pretty close to working (at least for the sqlite driver).  More debugging and troubleshooting to go!

commit d494d67
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:47:23 2023 -0400

    refs #278 fix ruff errors

    adding # ruff: noqa to test files

commit cfd3fd7
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:38:08 2023 -0400

    refs #278 fix ruff error

    Ignore another SIM102 error.  This one would be much messier to combine the if statements.

    Looks like the .ruffignore is not working either!

commit f66000c
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:35:41 2023 -0400

    refs #278 fix ruff error

    Ignore another SIM102 error.  This one would be much messier to combine the if statements.

    Looks like the .ruggignore is not working either!

commit d504891
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:31:29 2023 -0400

    refs #278 fix ruff error

    Fixed a SIM102 error flagged by ruff.  This commit should also test if the .ruffignore file is working...

commit 8191b8f
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:25:21 2023 -0400

    refs #278 Unit Tests ruff ignore

    add a .ruffignore file to ignore the /tests folder

commit 61fc8ec
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 01:21:17 2023 -0400

    refs #278 Unit Test example for ProgressAnimate

    Finished up ProgressAnimate testing file along with improvments to bulletproof ProgressAnimate

commit 7a97927
Merge: 65239d9 2d6938f
Author: PySimpleSQL <[email protected]>
Date:   Fri Apr 14 00:23:56 2023 -0400

    refs #278 Unit Test example for ProgressAnimate

    Not perfect yet, but shows the basic concepts of testing for both no failures and expected failures.  I tried to fix things in ProgressAnimate as I went along so that hopefully you can see the correlation between what was being tested, and the fixes that went in to pass the tests.

    If you haven't used pytest before, there's a few things to do:
    - pip install pytest
    - make sure pysimplesql is reachable as a module.  The easiest way is to do a local installation by running `pip -e .` in the pysimplesql root directory
    - from the commandline, run `pytest` to run all tests.  Or you can run tests for a specific file, I.e. `pytest progressanimate_test.py`
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