Bug Fixes
- Closes 20, All derives should now be in where clause
([`c736b25`](https://github.com/PRQL/pyprql/commit/c736b25b97a3fc7b3a2f873df6860139626b38d2))
- Closes 21, replace_tables now available to all to_sql transformations
([`eb12075`](https://github.com/PRQL/pyprql/commit/eb1207595af4f86df9496c1c7d441b5ab4f8b566))
- Final commit for fix11
([`421fb04`](https://github.com/PRQL/pyprql/commit/421fb044b687a63547c45562193ad18c4940145e))
- Fix11 , use the AST in the completer. This adds support for table aliases when completing fields.
([`9e79119`](https://github.com/PRQL/pyprql/commit/9e79119b0fd308ab5928f50e447e4623a9ed18c2))
- Fixes 10 typing a letter afer period was not auto completing
([`ee8c7f5`](https://github.com/PRQL/pyprql/commit/ee8c7f57bd84e0b535441b546a96949f57280ecb))
- **prql.lark**: Match file names directly
([`259763b`](https://github.com/PRQL/pyprql/commit/259763b877f9e4385c60f3a986961b9a533892df))
Provides a regex to directly match file names for parsing. I'm reasonably confident there is
probably an edge case, but this seems to handle most path situations I can think of.
- **prql.lark**: Support extensions for to statement
([`82325a6`](https://github.com/PRQL/pyprql/commit/82325a66c5d5d73e8382011fe2ca681f24914aa6))
file_name should be of type name to allow for extensions.
This doesn't cover full file paths yet. Common separators (eg /, ~) still fail to parse correctly.
- **prql.parl**: Add filename parameter
([`f567cd6`](https://github.com/PRQL/pyprql/commit/f567cd6b0a8e2e58488ef392e3d212159ab76f2a))
I'd forgot to add a filename parameter when constructing the grammar.
Build System
- **pyproject.toml**: Add pandas
([`88d988f`](https://github.com/PRQL/pyprql/commit/88d988f567c0e63f0f4964b73ddb60858ed578e8))
Requires a split version specification, as pandas 1.3 does not support 3.10, while pandas 1.4 does
not support 3.7
- **pyproject.toml**: Specify numpy version
([`8db2338`](https://github.com/PRQL/pyprql/commit/8db2338a5a311ef3d25a9e7eba91bc5db9a8cf21))
Specifies the numpy version to make sure we are using secure versions. The security patches require
>1.22.2, however, which is incompatible with python 3.7, so a split version specification is
givern. Security met for python >= 3.8. Note, as well, that the numpy team rate all affected
vulnerabilities very, very low.
Code Style
- *****: Apply lints
([`f2769e9`](https://github.com/PRQL/pyprql/commit/f2769e97d32150d06d0cb9bd6b43a4794b541043))
Continuous Integration
- **action.yml**: Add custom set-up nox
([`da56480`](https://github.com/PRQL/pyprql/commit/da564806bf14a1bc6e10f511f0d2d62d38e02314))
Given that the current set up nox action is broken, we create our own, and add some additional
features, including caching of the nox install and isntallation of poetry.
Inspired by:
https://github.com/scikit-build/scikit-build/blob/master/.github/actions/setup-nox/action.yml
- **cicd.yml**: Correct action path
([`ae0e7f7`](https://github.com/PRQL/pyprql/commit/ae0e7f7ab611a5be91305c0baa8d419c66010a4f))
- **cicd.yml**: Use custom nox action
([`b5337e3`](https://github.com/PRQL/pyprql/commit/b5337e328325f1eb985c181a38232218a947a3cc))
Update our cicd action to use our personal nox composite action.
Documentation
- Adding more prql examples
([`2e5149e`](https://github.com/PRQL/pyprql/commit/2e5149e36d167bb16d82de30676941b7c3f519a4))
- Adding prql examples
([`8ae2070`](https://github.com/PRQL/pyprql/commit/8ae2070a6d07c51c5df201de4a73a7435942478f))
- **cli.py**: Document connect_str properly
([`95e568d`](https://github.com/PRQL/pyprql/commit/95e568d6ba4bd581ba276290cc4dd10dff9a87f4))
Lints prefer init documented directly under class.
Features
- Adding code completion on table names for ':', fixes the handling of prev_selection by clearing
out on whitespace
([`46f7676`](https://github.com/PRQL/pyprql/commit/46f7676af190d1e5d008cc9f283628a2a47304f2))
- Adding completion for show columns and \d+
([`7b7f676`](https://github.com/PRQL/pyprql/commit/7b7f6768a4519de7ac8fbdc8458b57fe35b8baf7))
- Adding expression parsing for complex expressions without requiring '()'
([`855ebd0`](https://github.com/PRQL/pyprql/commit/855ebd0166e06f9d1e288c63b7e529f73e105e61))
- *****: Support saving to tsv
([`5a2630f`](https://github.com/PRQL/pyprql/commit/5a2630f7314b0a2ad04333b745d870f39d083486))
Users can now dump to TSV files. Need to add support for reading from them as well.
- **cli.py**: Import csv
([`c847eb2`](https://github.com/PRQL/pyprql/commit/c847eb269b0f48889e5b625b97377283a54b1bd1))
If the passed connection string points to a csv, then an in-memory sqlite database is created, and
the contents of the csv are dumped to the database. This could cause performance issues with very
large databases - both from storing the database in memory, and a speed hit for using
pd.DataFrame.to_sql to dump the dataframe. However, performance seems satisfactory on reasonable
sized datasets.
- **cli.py**: Support cli saving to csv
([`79382c1`](https://github.com/PRQL/pyprql/commit/79382c1aef6bd0e9c7f1e4686fde84b1e11b5f6d))
Now, users can dump query results to csv for downstream processing.
- **cli.py**: Support reading from tsvs
([`d2d675b`](https://github.com/PRQL/pyprql/commit/d2d675b7f398f8b32b27117cff1d2305ee85a811))
Now users can read from TSVs as well!
- **prql.py**: Adds grammar for to
([`3899c89`](https://github.com/PRQL/pyprql/commit/3899c89fcd6dc735a2fe6a09fd488bfff0a0fb4b))
Borrowing from the structure used for Joins, this grammar provides a parse-able `to` clause.
Currently, it only implements a grammar for CSVs, but it could be easily expanded to support
additional filetypes. THE PARSING IS NOT HERE IMPLEMENTED.
- **prql.py**: Parse to statements
([`2808f26`](https://github.com/PRQL/pyprql/commit/2808f26fb13b82d3800b6e0e92f3a12733291b9e))
Adds to statement support to the AST, allowing for parsing of to in a pipeline.
Refactoring
- Allowing for order named arg on sort placeable anywhere
([`5fd0c1f`](https://github.com/PRQL/pyprql/commit/5fd0c1f92fe0f3021de369cfaa7b905ffcb90a68))
- Clean up
([`559dab1`](https://github.com/PRQL/pyprql/commit/559dab108e9069a053306702cd97395dccee0834))
- Fixes 24, had junk data in the database causing weird results
([`f2d6058`](https://github.com/PRQL/pyprql/commit/f2d6058309be6878d0c30bd9ffc7de79128651cc))
- Updating grammar to not require () around expressions
([`3a6852a`](https://github.com/PRQL/pyprql/commit/3a6852a3d219e9b80bcc637d90783d95a906e855))
- *****: Improve CLI structure
([`bc9bb72`](https://github.com/PRQL/pyprql/commit/bc9bb72a20ca5119203cf02d404a618c847f9a85))
Move logic for running CLI into __init__, while providing a separate module for each of the main
components of the CLI (Lexer, Style, Completer, CLI).
- **prql.py**: Ignore type errors in 3.7
([`043e96c`](https://github.com/PRQL/pyprql/commit/043e96c4a34a2154d26158b8e7936750d1e8a2ba))
For some reason, some false positive type errors are thrown for 2 lines in python 3.7 only. As they
pass in >= 3.8 and are definitely not errors, they are ignored.
Testing
- **test_grammar.py**: Add unit tests for to statements
([`e8ff715`](https://github.com/PRQL/pyprql/commit/e8ff715b1c5cc76ee5b6a19eb1672ec169b2bec1))
Includes a (currently) failing test for complex file names. Will need to fix this in a future
commit.
- **test_grammar.py**: Correct index
([`3c68f01`](https://github.com/PRQL/pyprql/commit/3c68f01f322ab5e9f8f3969c201a212d0651b75a))
The searched for string in the test_aggregates_grammar_nested should occur at position == 0, not >
0.
- **test_grammar.py**: Exapnd to test coverage
([`0c1f06e`](https://github.com/PRQL/pyprql/commit/0c1f06eed1f06f6ca638292780ec351825007346))
Expands test coverage for complex file names with the to clause, using parametrisation to provide
coverage for both windows and Linux/Mac cases.