├── .github ├── CODE_OF_CONDUCT.md ├── dependabot.yml └── workflows │ ├── pull-request.yaml │ └── release.yaml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yaml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── docs ├── PRQL_Demo.ipynb ├── archive │ ├── cli.md │ ├── contributing.md │ ├── pyprql.md │ └── styler.md ├── changelog.md ├── conf.py ├── index.md ├── magic_api.md └── magic_readme.md ├── noxfile.py ├── poetry.lock ├── pyproject.toml └── pyprql ├── __init__.py ├── magic ├── README.md ├── __init__.py └── prql.py ├── pandas_accessor ├── __init__.py └── prql.py ├── polars_namespace ├── __init__.py └── prql.py ├── py.typed └── tests ├── __init__.py ├── _regtest_outputs ├── test_magic.test_memory_db.out └── test_magic.test_pass_existing_engine.out ├── conftest.py ├── test_magic.py ├── test_polars_namespace.py └── test_prql_python.py /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, caste, color, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | - Demonstrating empathy and kindness toward other people 21 | - Being respectful of differing opinions, viewpoints, and experiences 22 | - Giving and gracefully accepting constructive feedback 23 | - Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | - Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | - The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | - Trolling, insulting or derogatory comments, and personal or political attacks 33 | - Public or private harassment 34 | - Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | - Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement email at 63 | rb.patterson.cross@gmail.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. 120 | 121 | Community Impact Guidelines were inspired by 122 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 123 | 124 | For answers to common questions about this code of conduct, see the FAQ at 125 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available 126 | at [https://www.contributor-covenant.org/translations][translations]. 127 | 128 | [homepage]: https://www.contributor-covenant.org 129 | [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html 130 | [Mozilla CoC]: https://github.com/mozilla/diversity 131 | [FAQ]: https://www.contributor-covenant.org/faq 132 | [translations]: https://www.contributor-covenant.org/translations 133 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | commit-message: 8 | prefix: "chore: " 9 | 10 | - package-ecosystem: pip 11 | directory: "/" 12 | schedule: 13 | interval: daily 14 | commit-message: 15 | prefix: "chore: " 16 | ignore: 17 | - dependency-name: "*" 18 | update-types: 19 | - version-update:semver-patch 20 | -------------------------------------------------------------------------------- /.github/workflows/pull-request.yaml: -------------------------------------------------------------------------------- 1 | name: pull-request 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | branches: 8 | - main 9 | 10 | workflow_dispatch: 11 | 12 | concurrency: 13 | group: ${{ github.workflow }}-${{ github.ref }} 14 | cancel-in-progress: true 15 | 16 | jobs: 17 | test: 18 | runs-on: ubuntu-latest 19 | strategy: 20 | matrix: 21 | os: 22 | - ubuntu-latest 23 | - windows-latest 24 | - macos-latest 25 | python-version: 26 | - "3.10" 27 | - "3.12" 28 | steps: 29 | - name: Checkout 30 | uses: actions/checkout@v4 31 | - uses: actions/setup-python@v5 32 | with: 33 | python-version: ${{ matrix.python-version }} 34 | - name: Install Poetry 35 | uses: snok/install-poetry@v1 36 | - run: poetry install 37 | - name: Test Code and Docs 38 | run: poetry run pytest 39 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: release 2 | on: 3 | workflow_dispatch: 4 | 5 | jobs: 6 | prep-release: 7 | if: github.event_name == 'workflow_dispatch' 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v4 12 | with: 13 | fetch-depth: 0 14 | 15 | - name: Setup Python 16 | uses: actions/setup-python@v5 17 | 18 | - name: Install Poetry 19 | uses: snok/install-poetry@v1 20 | 21 | - name: Cache Pip 22 | uses: actions/cache@v4 23 | with: 24 | path: ~/.pip 25 | key: ${{ runner.os }}-pip 26 | restore-keys: ${{ runner.os }}-pip 27 | 28 | - run: poetry install 29 | 30 | - name: Configure git 31 | run: | 32 | git config --global user.name 'GitHub Actions' 33 | git config --global user.email 'gha@prql-lang.org' 34 | 35 | - name: Python Semantic Release 36 | env: 37 | GH_TOKEN: ${{ secrets.PRQL_BOT_GITHUB_TOKEN }} 38 | run: | 39 | poetry run semantic-release --verbose version --skip-build --no-vcs-release 40 | poetry build 41 | 42 | - name: Upload dist 43 | uses: actions/upload-artifact@v4 44 | with: 45 | name: dist 46 | path: dist 47 | 48 | create-release: 49 | needs: prep-release 50 | runs-on: ubuntu-latest 51 | permissions: 52 | id-token: write 53 | steps: 54 | - name: Checkout 55 | uses: actions/checkout@v4 56 | with: 57 | fetch-depth: 0 58 | 59 | - uses: actions/download-artifact@v4 60 | with: 61 | name: dist 62 | path: dist 63 | 64 | - name: Publish package distributions to PyPI 65 | uses: pypa/gh-action-pypi-publish@release/v1 66 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | .idea/ 6 | scratch.py 7 | .python-version 8 | .prql-history.txt 9 | *.db 10 | .DS_store 11 | docs/_build 12 | Session.vim* 13 | coverage.xml 14 | .coverage 15 | .ipynb_checkpoints 16 | dist 17 | .dmypy.json 18 | /*.ipynb 19 | *.csv 20 | _build 21 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | default_language_version: 2 | python: python3.11 3 | default_stages: [pre-commit] 4 | 5 | repos: 6 | - repo: https://github.com/pre-commit/pre-commit-hooks 7 | rev: v5.0.0 8 | hooks: 9 | - id: check-toml 10 | - id: check-yaml 11 | - id: end-of-file-fixer 12 | - id: trailing-whitespace 13 | - id: check-added-large-files 14 | - repo: https://github.com/astral-sh/ruff-pre-commit 15 | rev: v0.11.12 16 | hooks: 17 | - id: ruff 18 | - id: ruff-format 19 | - repo: https://github.com/pre-commit/mirrors-mypy 20 | rev: v1.16.0 21 | hooks: 22 | - id: mypy 23 | - repo: https://github.com/python-poetry/poetry 24 | rev: 2.1.3 25 | hooks: 26 | - id: poetry-check 27 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 2 | 3 | # Required 4 | version: 2 5 | 6 | # Set the version of Python and other tools you might need 7 | # Defaults to 3.7 which doesn't support using defaults for typing 8 | build: 9 | os: ubuntu-20.04 10 | tools: 11 | python: "3.10" 12 | jobs: 13 | # https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry 14 | post_create_environment: 15 | - pip install poetry 16 | - poetry config virtualenvs.create false 17 | post_install: 18 | - poetry install 19 | 20 | # Build documentation in the docs/ directory with Sphinx 21 | sphinx: 22 | configuration: docs/conf.py 23 | fail_on_warning: true 24 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | 4 | ## v0.13.0 (2025-02-07) 5 | 6 | ### Bug Fixes 7 | 8 | - Drop python 3.8-3.9, upgrade deps, use ruff format 9 | ([#429](https://github.com/PRQL/pyprql/pull/429), 10 | [`d85ec04`](https://github.com/PRQL/pyprql/commit/d85ec04eb50dc01cc063130f0219b23db9adeadb)) 11 | 12 | - Ruff error ([#402](https://github.com/PRQL/pyprql/pull/402), 13 | [`69fa53f`](https://github.com/PRQL/pyprql/commit/69fa53fa8ff99eb8dd57d13259b92fe86007cab8)) 14 | 15 | ### Build System 16 | 17 | - Remove explicit ipython dependency ([#383](https://github.com/PRQL/pyprql/pull/383), 18 | [`9ce5745`](https://github.com/PRQL/pyprql/commit/9ce5745d8082b412183845aab388c5341964b1b3)) 19 | 20 | ### Chores 21 | 22 | - Bump black from 24.4.2 to 24.8.0 ([#410](https://github.com/PRQL/pyprql/pull/410), 23 | [`81ba27b`](https://github.com/PRQL/pyprql/commit/81ba27b3363434863dc52ce96188a0311d1c6e8b)) 24 | 25 | - Bump commitizen from 3.25.0 to 3.26.0 ([#386](https://github.com/PRQL/pyprql/pull/386), 26 | [`e926bf4`](https://github.com/PRQL/pyprql/commit/e926bf4faf47ec32756a560ed630340e1d350856)) 27 | 28 | Signed-off-by: dependabot[bot] 29 | 30 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 31 | 32 | - Bump commitizen from 3.26.0 to 3.27.0 ([#387](https://github.com/PRQL/pyprql/pull/387), 33 | [`5d3fa73`](https://github.com/PRQL/pyprql/commit/5d3fa73b99e7371c9b25d8db0a7f4c1178f427ff)) 34 | 35 | - Bump commitizen from 3.27.0 to 3.28.0 ([#404](https://github.com/PRQL/pyprql/pull/404), 36 | [`7356055`](https://github.com/PRQL/pyprql/commit/7356055b054c1cacdbdc35238f5fe2ecb8513882)) 37 | 38 | - Bump commitizen from 3.28.0 to 3.29.0 ([#413](https://github.com/PRQL/pyprql/pull/413), 39 | [`3255bb4`](https://github.com/PRQL/pyprql/commit/3255bb4fc653b9fd0f00443e7aaee8d3a6deeb15)) 40 | 41 | Signed-off-by: dependabot[bot] 42 | 43 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 44 | 45 | - Bump coverage from 7.5.0 to 7.6.0 ([#400](https://github.com/PRQL/pyprql/pull/400), 46 | [`2d0472e`](https://github.com/PRQL/pyprql/commit/2d0472e242138e58009ae907bf7f5cf142fc8e42)) 47 | 48 | Signed-off-by: dependabot[bot] 49 | 50 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 51 | 52 | - Bump duckdb-engine from 0.12.0 to 0.13.0 ([#390](https://github.com/PRQL/pyprql/pull/390), 53 | [`2ea60db`](https://github.com/PRQL/pyprql/commit/2ea60db79d2a397ded3a5ddb048cf907586cfe00)) 54 | 55 | Signed-off-by: dependabot[bot] 56 | 57 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 58 | 59 | - Bump duckdb-engine from 0.13.2 to 0.14.0 ([#458](https://github.com/PRQL/pyprql/pull/458), 60 | [`3cb05fd`](https://github.com/PRQL/pyprql/commit/3cb05fd92aaafafb873fe923838f3242ae48181e)) 61 | 62 | Signed-off-by: dependabot[bot] 63 | 64 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 65 | 66 | - Bump duckdb-engine from 0.14.0 to 0.15.0 ([#468](https://github.com/PRQL/pyprql/pull/468), 67 | [`4d34a7e`](https://github.com/PRQL/pyprql/commit/4d34a7ef87d8c229946324acacabfacb86052a94)) 68 | 69 | - Bump ipython from 8.28.0 to 8.29.0 ([#444](https://github.com/PRQL/pyprql/pull/444), 70 | [`77b4c2f`](https://github.com/PRQL/pyprql/commit/77b4c2f7983a65ab040d92cbe682fb71d8e46e6a)) 71 | 72 | Signed-off-by: dependabot[bot] 73 | 74 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 75 | 76 | - Bump ipython from 8.29.0 to 8.30.0 ([#454](https://github.com/PRQL/pyprql/pull/454), 77 | [`e6380e1`](https://github.com/PRQL/pyprql/commit/e6380e1b5447baa84b5754128f944a9324074631)) 78 | 79 | Signed-off-by: dependabot[bot] 80 | 81 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 82 | 83 | - Bump ipython from 8.30.0 to 8.31.0 ([#459](https://github.com/PRQL/pyprql/pull/459), 84 | [`64128d1`](https://github.com/PRQL/pyprql/commit/64128d13ea6b790cca21fcd8e3a92de395d859fa)) 85 | 86 | Signed-off-by: dependabot[bot] 87 | 88 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 89 | 90 | - Bump mypy from 1.10.0 to 1.11.0 ([#406](https://github.com/PRQL/pyprql/pull/406), 91 | [`affcb86`](https://github.com/PRQL/pyprql/commit/affcb86f6c31760826754fab2cdc475da8633d91)) 92 | 93 | - Bump mypy from 1.11.2 to 1.12.0 ([#436](https://github.com/PRQL/pyprql/pull/436), 94 | [`659a2e1`](https://github.com/PRQL/pyprql/commit/659a2e1481dab1f734f78aaff9f1978b7714f5ef)) 95 | 96 | - Bump mypy from 1.12.0 to 1.13.0 ([#442](https://github.com/PRQL/pyprql/pull/442), 97 | [`15ac390`](https://github.com/PRQL/pyprql/commit/15ac390613150d03bc6e6822f98bf9f1e31cbe07)) 98 | 99 | Signed-off-by: dependabot[bot] 100 | 101 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 102 | 103 | - Bump mypy from 1.13.0 to 1.14.1 ([#462](https://github.com/PRQL/pyprql/pull/462), 104 | [`957e372`](https://github.com/PRQL/pyprql/commit/957e372b659e66bd45600a6fb7fa8315202e1b24)) 105 | 106 | Signed-off-by: dependabot[bot] 107 | 108 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 109 | 110 | - Bump myst-parser from 3.0.1 to 4.0.0 ([#434](https://github.com/PRQL/pyprql/pull/434), 111 | [`a2f5719`](https://github.com/PRQL/pyprql/commit/a2f571961623c6d5bcf8c4d739916f66ed7b87d6)) 112 | 113 | - Bump nox from 2024.4.15 to 2024.10.9 ([#430](https://github.com/PRQL/pyprql/pull/430), 114 | [`e0ad239`](https://github.com/PRQL/pyprql/commit/e0ad239e81cdf8e5e0af1ac5bf865754d8cd1c89)) 115 | 116 | Signed-off-by: dependabot[bot] 117 | 118 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 119 | 120 | - Bump polars from 0.20.23 to 1.0.0 ([#397](https://github.com/PRQL/pyprql/pull/397), 121 | [`94e879f`](https://github.com/PRQL/pyprql/commit/94e879ff0b29a22a09fb4dd483994cb6800eac56)) 122 | 123 | - Bump polars from 1.0.0 to 1.1.0 ([#398](https://github.com/PRQL/pyprql/pull/398), 124 | [`b0e2506`](https://github.com/PRQL/pyprql/commit/b0e2506ffc9f217212ad2badee3d0f5b94c7579c)) 125 | 126 | - Bump polars from 1.1.0 to 1.2.0 ([#403](https://github.com/PRQL/pyprql/pull/403), 127 | [`7474239`](https://github.com/PRQL/pyprql/commit/7474239db7427f5305223574f881e7a4a0090d97)) 128 | 129 | Signed-off-by: dependabot[bot] 130 | 131 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 132 | 133 | - Bump polars from 1.10.0 to 1.11.0 ([#443](https://github.com/PRQL/pyprql/pull/443), 134 | [`b05f4bb`](https://github.com/PRQL/pyprql/commit/b05f4bb449fcd85035f50d59af9258d82d0112fd)) 135 | 136 | - Bump polars from 1.11.0 to 1.12.0 ([#445](https://github.com/PRQL/pyprql/pull/445), 137 | [`bdcc11c`](https://github.com/PRQL/pyprql/commit/bdcc11cfbe7fbd8aa2349d82291fc18e5da70fc2)) 138 | 139 | Signed-off-by: dependabot[bot] 140 | 141 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 142 | 143 | - Bump polars from 1.12.0 to 1.13.0 ([#449](https://github.com/PRQL/pyprql/pull/449), 144 | [`acf6056`](https://github.com/PRQL/pyprql/commit/acf6056eef6e14431c78669806c4fc2cdb4f6c84)) 145 | 146 | - Bump polars from 1.13.0 to 1.14.0 ([#450](https://github.com/PRQL/pyprql/pull/450), 147 | [`f95d5ba`](https://github.com/PRQL/pyprql/commit/f95d5ba593510ddcdd144308bab79f7a40ece209)) 148 | 149 | - Bump polars from 1.14.0 to 1.15.0 ([#452](https://github.com/PRQL/pyprql/pull/452), 150 | [`0e34169`](https://github.com/PRQL/pyprql/commit/0e341694db551d589b93b3c929cd0f0afeacc4a0)) 151 | 152 | - Bump polars from 1.15.0 to 1.16.0 ([#455](https://github.com/PRQL/pyprql/pull/455), 153 | [`b151306`](https://github.com/PRQL/pyprql/commit/b151306116c939402ac27d1f990e7b1c64be7669)) 154 | 155 | Signed-off-by: dependabot[bot] 156 | 157 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 158 | 159 | - Bump polars from 1.16.0 to 1.17.0 ([#457](https://github.com/PRQL/pyprql/pull/457), 160 | [`ea5bd01`](https://github.com/PRQL/pyprql/commit/ea5bd0170893ec5e8b752f2465ab30351f177e72)) 161 | 162 | - Bump polars from 1.17.0 to 1.18.0 ([#461](https://github.com/PRQL/pyprql/pull/461), 163 | [`4bab67f`](https://github.com/PRQL/pyprql/commit/4bab67f08cedf52b23102493a20625639fb3c442)) 164 | 165 | Signed-off-by: dependabot[bot] 166 | 167 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 168 | 169 | - Bump polars from 1.18.0 to 1.19.0 ([#464](https://github.com/PRQL/pyprql/pull/464), 170 | [`0f64079`](https://github.com/PRQL/pyprql/commit/0f6407987681a7a291a93cfd20867b8b0355523d)) 171 | 172 | - Bump polars from 1.19.0 to 1.20.0 ([#469](https://github.com/PRQL/pyprql/pull/469), 173 | [`724ddd4`](https://github.com/PRQL/pyprql/commit/724ddd4a3bb2c17a2ea9344d0dca38ab54712800)) 174 | 175 | - Bump polars from 1.2.0 to 1.3.0 ([#408](https://github.com/PRQL/pyprql/pull/408), 176 | [`6c76c96`](https://github.com/PRQL/pyprql/commit/6c76c96919e1cadfad7bc30d375fac86b173e516)) 177 | 178 | Signed-off-by: dependabot[bot] 179 | 180 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 181 | 182 | - Bump polars from 1.20.0 to 1.21.0 ([#475](https://github.com/PRQL/pyprql/pull/475), 183 | [`e3c1e9e`](https://github.com/PRQL/pyprql/commit/e3c1e9e39d4a0e84f4e6f1276c2fee396f5179e9)) 184 | 185 | Signed-off-by: dependabot[bot] 186 | 187 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 188 | 189 | - Bump polars from 1.3.0 to 1.4.1 ([#411](https://github.com/PRQL/pyprql/pull/411), 190 | [`f821a38`](https://github.com/PRQL/pyprql/commit/f821a388b4e446b794e63aa5ed53c4a40b08fca9)) 191 | 192 | - Bump polars from 1.4.1 to 1.5.0 ([#415](https://github.com/PRQL/pyprql/pull/415), 193 | [`1856b49`](https://github.com/PRQL/pyprql/commit/1856b497d53e841f6bdf06ebd9c6e10b6482b83e)) 194 | 195 | Signed-off-by: dependabot[bot] 196 | 197 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 198 | 199 | - Bump polars from 1.5.0 to 1.6.0 ([#419](https://github.com/PRQL/pyprql/pull/419), 200 | [`429b120`](https://github.com/PRQL/pyprql/commit/429b12095dd560fee2b9c3255cb8fe2b59570818)) 201 | 202 | Signed-off-by: dependabot[bot] 203 | 204 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 205 | 206 | - Bump polars from 1.6.0 to 1.7.0 ([#420](https://github.com/PRQL/pyprql/pull/420), 207 | [`867e3e5`](https://github.com/PRQL/pyprql/commit/867e3e546fdce4f073b839cc78f372c73276eefa)) 208 | 209 | Signed-off-by: dependabot[bot] 210 | 211 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 212 | 213 | - Bump polars from 1.7.0 to 1.8.1 ([#421](https://github.com/PRQL/pyprql/pull/421), 214 | [`e454cc0`](https://github.com/PRQL/pyprql/commit/e454cc0b75998b1272747c18a1e53020520f03f4)) 215 | 216 | Signed-off-by: dependabot[bot] 217 | 218 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 219 | 220 | - Bump polars from 1.8.1 to 1.8.2 ([#424](https://github.com/PRQL/pyprql/pull/424), 221 | [`570624b`](https://github.com/PRQL/pyprql/commit/570624b608b48f031b7856b4fbd2076637d78de9)) 222 | 223 | Signed-off-by: dependabot[bot] 224 | 225 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 226 | 227 | - Bump polars from 1.9.0 to 1.10.0 ([#441](https://github.com/PRQL/pyprql/pull/441), 228 | [`1c9f2a4`](https://github.com/PRQL/pyprql/commit/1c9f2a41fee0302c6c0e3a354fd6008885f08d5a)) 229 | 230 | Signed-off-by: dependabot[bot] 231 | 232 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 233 | 234 | - Bump pre-commit from 3.8.0 to 4.0.1 ([#435](https://github.com/PRQL/pyprql/pull/435), 235 | [`7c4b69c`](https://github.com/PRQL/pyprql/commit/7c4b69cee9968b30208368d21b0db4f1035ce8cf)) 236 | 237 | - Bump pre-commit from 4.0.1 to 4.1.0 ([#471](https://github.com/PRQL/pyprql/pull/471), 238 | [`50be6f4`](https://github.com/PRQL/pyprql/commit/50be6f49e1a2f23d95e8867f850a49ca0487dc58)) 239 | 240 | Signed-off-by: dependabot[bot] 241 | 242 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 243 | 244 | - Bump pytest from 8.2.0 to 8.3.1 ([#405](https://github.com/PRQL/pyprql/pull/405), 245 | [`282d5f7`](https://github.com/PRQL/pyprql/commit/282d5f787aa689f55f0b0a0c1402304e93acd416)) 246 | 247 | - Bump pytest-cov from 5.0.0 to 6.0.0 ([#446](https://github.com/PRQL/pyprql/pull/446), 248 | [`f2041e5`](https://github.com/PRQL/pyprql/commit/f2041e58c52ad80e9537920b9b1202fca1422784)) 249 | 250 | - Bump pytest-regtest from 2.2.1 to 2.3.0 ([#438](https://github.com/PRQL/pyprql/pull/438), 251 | [`acd51d9`](https://github.com/PRQL/pyprql/commit/acd51d94f2e0f54b8fdee9bcda87a9d85bb2b84b)) 252 | 253 | - Bump python-semantic-release from 9.10.0 to 9.11.0 254 | ([#431](https://github.com/PRQL/pyprql/pull/431), 255 | [`dec8234`](https://github.com/PRQL/pyprql/commit/dec8234a29ef58b34765f298be98be4e7c06c70c)) 256 | 257 | - Bump python-semantic-release from 9.11.0 to 9.12.0 258 | ([#440](https://github.com/PRQL/pyprql/pull/440), 259 | [`313e14b`](https://github.com/PRQL/pyprql/commit/313e14b731e3fcf567b5d92125ce953d14a2589c)) 260 | 261 | - Bump python-semantic-release from 9.12.0 to 9.13.0 262 | ([#447](https://github.com/PRQL/pyprql/pull/447), 263 | [`9021ad5`](https://github.com/PRQL/pyprql/commit/9021ad57136ae7d51c9a3fe0ba5bc03d7688717a)) 264 | 265 | Signed-off-by: dependabot[bot] 266 | 267 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 268 | 269 | - Bump python-semantic-release from 9.13.0 to 9.14.0 270 | ([#448](https://github.com/PRQL/pyprql/pull/448), 271 | [`72c5365`](https://github.com/PRQL/pyprql/commit/72c53652697ce14b1d66bc74bcc2e9e7dc1ea72c)) 272 | 273 | Signed-off-by: dependabot[bot] 274 | 275 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 276 | 277 | - Bump python-semantic-release from 9.14.0 to 9.15.0 278 | ([#456](https://github.com/PRQL/pyprql/pull/456), 279 | [`54f811a`](https://github.com/PRQL/pyprql/commit/54f811a2fc9363e960640517b2adfbdf1796de52)) 280 | 281 | Signed-off-by: dependabot[bot] 282 | 283 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 284 | 285 | - Bump python-semantic-release from 9.15.0 to 9.16.1 286 | ([#467](https://github.com/PRQL/pyprql/pull/467), 287 | [`2b55095`](https://github.com/PRQL/pyprql/commit/2b55095cb94fdb578458b7bbfc95b82943b792d6)) 288 | 289 | Signed-off-by: dependabot[bot] 290 | 291 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 292 | 293 | - Bump python-semantic-release from 9.16.1 to 9.17.0 294 | ([#474](https://github.com/PRQL/pyprql/pull/474), 295 | [`bb9b5b6`](https://github.com/PRQL/pyprql/commit/bb9b5b64aed8693e2e4180f4417de5e795f26884)) 296 | 297 | Signed-off-by: dependabot[bot] 298 | 299 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 300 | 301 | - Bump python-semantic-release from 9.7.0 to 9.8.0 ([#389](https://github.com/PRQL/pyprql/pull/389), 302 | [`4dedfbc`](https://github.com/PRQL/pyprql/commit/4dedfbc3cf156c5af403aeeb650a84e1cb988f84)) 303 | 304 | - Bump python-semantic-release from 9.8.0 to 9.9.0 ([#422](https://github.com/PRQL/pyprql/pull/422), 305 | [`bc1ded6`](https://github.com/PRQL/pyprql/commit/bc1ded60f680b2facd47fe9ab151c9fa03ca4a8c)) 306 | 307 | Signed-off-by: dependabot[bot] 308 | 309 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 310 | 311 | - Bump python-semantic-release from 9.9.0 to 9.10.0 312 | ([#428](https://github.com/PRQL/pyprql/pull/428), 313 | [`6e11062`](https://github.com/PRQL/pyprql/commit/6e11062c6e7a6bea915265b53a2cc89f8eb79329)) 314 | 315 | Signed-off-by: dependabot[bot] 316 | 317 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 318 | 319 | - Bump ruff from 0.4.2 to 0.5.0 ([#395](https://github.com/PRQL/pyprql/pull/395), 320 | [`afaf289`](https://github.com/PRQL/pyprql/commit/afaf289a42026692cc8d5e961ee392fa42919bf4)) 321 | 322 | Signed-off-by: dependabot[bot] 323 | 324 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 325 | 326 | - Bump ruff from 0.5.0 to 0.6.0 ([#416](https://github.com/PRQL/pyprql/pull/416), 327 | [`e09a62a`](https://github.com/PRQL/pyprql/commit/e09a62add855e6368316e42b44ee7b1f2f86e658)) 328 | 329 | Signed-off-by: dependabot[bot] 330 | 331 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 332 | 333 | - Bump ruff from 0.6.9 to 0.7.0 ([#439](https://github.com/PRQL/pyprql/pull/439), 334 | [`fb652c4`](https://github.com/PRQL/pyprql/commit/fb652c457048f25df8b3f311f33ea1a317692b36)) 335 | 336 | Signed-off-by: dependabot[bot] 337 | 338 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 339 | 340 | - Bump ruff from 0.7.0 to 0.8.0 ([#451](https://github.com/PRQL/pyprql/pull/451), 341 | [`2d908c7`](https://github.com/PRQL/pyprql/commit/2d908c717457302d3bfc034eade7b737e7c7775e)) 342 | 343 | - Bump ruff from 0.8.0 to 0.9.0 ([#466](https://github.com/PRQL/pyprql/pull/466), 344 | [`e7232b3`](https://github.com/PRQL/pyprql/commit/e7232b3c969df8dd072ac6a2d069f0268575f50d)) 345 | 346 | - Bump sphinx from 7.1.2 to 8.1.3 ([#437](https://github.com/PRQL/pyprql/pull/437), 347 | [`f8069e8`](https://github.com/PRQL/pyprql/commit/f8069e89cec179f7b0d8290943931820b17d0b6a)) 348 | 349 | - Bump sphinx-rtd-theme from 2.0.0 to 3.0.0 ([#426](https://github.com/PRQL/pyprql/pull/426), 350 | [`426d5d2`](https://github.com/PRQL/pyprql/commit/426d5d2f7c62d1c3c110ba8913b90428e55bd40e)) 351 | 352 | Signed-off-by: dependabot[bot] 353 | 354 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 355 | 356 | - Bump twine from 5.0.0 to 5.1.0 ([#385](https://github.com/PRQL/pyprql/pull/385), 357 | [`e2b36f0`](https://github.com/PRQL/pyprql/commit/e2b36f0836d57433a3cc11b3bc166138c3257e86)) 358 | 359 | Signed-off-by: dependabot[bot] 360 | 361 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 362 | 363 | - Bump twine from 5.1.1 to 6.0.1 ([#453](https://github.com/PRQL/pyprql/pull/453), 364 | [`f67ca8b`](https://github.com/PRQL/pyprql/commit/f67ca8b535d77c100fcd0b2d72fb838817bab68e)) 365 | 366 | Signed-off-by: dependabot[bot] 367 | 368 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 369 | 370 | - Bump twine from 6.0.1 to 6.1.0 ([#472](https://github.com/PRQL/pyprql/pull/472), 371 | [`1e00236`](https://github.com/PRQL/pyprql/commit/1e00236b3c217b5f84c79e294bc6f29b21f70664)) 372 | 373 | Signed-off-by: dependabot[bot] 374 | 375 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 376 | 377 | - Bump xdoctest from 1.1.3 to 1.2.0 ([#418](https://github.com/PRQL/pyprql/pull/418), 378 | [`4e6c4c5`](https://github.com/PRQL/pyprql/commit/4e6c4c5079f19c92a9bdf12497362bfe2150bce8)) 379 | 380 | Signed-off-by: dependabot[bot] 381 | 382 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 383 | 384 | - Ensure prqlc >= 0.13 ([#481](https://github.com/PRQL/pyprql/pull/481), 385 | [`90ce105`](https://github.com/PRQL/pyprql/commit/90ce1050d0910cb087d6730267a55c2816a654c7)) 386 | 387 | - Update pre-commit config ([#463](https://github.com/PRQL/pyprql/pull/463), 388 | [`8653eb0`](https://github.com/PRQL/pyprql/commit/8653eb041eb38da47cfcf7d81da4f3b40eb02769)) 389 | 390 | ### Features 391 | 392 | - Bump prqlc from 0.11.3 to 0.13.3 ([#473](https://github.com/PRQL/pyprql/pull/473), 393 | [`376e782`](https://github.com/PRQL/pyprql/commit/376e782d286a271f710180829916b123d5ac9c93)) 394 | 395 | Signed-off-by: dependabot[bot] 396 | 397 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 398 | 399 | 400 | ## v0.12.1 (2024-05-06) 401 | 402 | ### Bug Fixes 403 | 404 | - Adjust `polars` extras definition ([#382](https://github.com/PRQL/pyprql/pull/382), 405 | [`e52b72f`](https://github.com/PRQL/pyprql/commit/e52b72f6bd1e8dcdbe9cdb89c6512dbf85f931bf)) 406 | 407 | ### Chores 408 | 409 | - Bump commitizen from 3.24.0 to 3.25.0 ([#377](https://github.com/PRQL/pyprql/pull/377), 410 | [`34ff83c`](https://github.com/PRQL/pyprql/commit/34ff83c12f7a32634f19fbae1359a0d6704e0eb9)) 411 | 412 | Signed-off-by: dependabot[bot] 413 | 414 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 415 | 416 | - Bump python-semantic-release from 9.5.0 to 9.6.0 ([#375](https://github.com/PRQL/pyprql/pull/375), 417 | [`7f9134b`](https://github.com/PRQL/pyprql/commit/7f9134b1ecb0804465a36050ff34e756454689de)) 418 | 419 | Signed-off-by: dependabot[bot] 420 | 421 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 422 | 423 | - Bump python-semantic-release from 9.6.0 to 9.7.0 ([#379](https://github.com/PRQL/pyprql/pull/379), 424 | [`b1a36dc`](https://github.com/PRQL/pyprql/commit/b1a36dc445ccc3fd630f68de8e0914fb5e7dc202)) 425 | 426 | Signed-off-by: dependabot[bot] 427 | 428 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 429 | 430 | - Bump safety from 3.1.0 to 3.2.0 ([#378](https://github.com/PRQL/pyprql/pull/378), 431 | [`ec5aac0`](https://github.com/PRQL/pyprql/commit/ec5aac0633ef2b36ff1da204da4e4249687fe9ad)) 432 | 433 | Signed-off-by: dependabot[bot] 434 | 435 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 436 | 437 | 438 | ## v0.12.0 (2024-04-29) 439 | 440 | ### Chores 441 | 442 | - Bump actions/cache from 3 to 4 ([#321](https://github.com/PRQL/pyprql/pull/321), 443 | [`5b63acc`](https://github.com/PRQL/pyprql/commit/5b63acce63bfc65b1f5686e13b862e15381e8e72)) 444 | 445 | - Bump black from 23.12.0 to 24.1.0 ([#323](https://github.com/PRQL/pyprql/pull/323), 446 | [`128b102`](https://github.com/PRQL/pyprql/commit/128b10295bc5db86fcf718b7c7a254d11b631391)) 447 | 448 | - Bump black from 24.1.0 to 24.2.0 ([#333](https://github.com/PRQL/pyprql/pull/333), 449 | [`835bd3c`](https://github.com/PRQL/pyprql/commit/835bd3c8e21cfdf7583e3ef70c0d47d583b7a48f)) 450 | 451 | - Bump black from 24.2.0 to 24.3.0 ([#345](https://github.com/PRQL/pyprql/pull/345), 452 | [`f8f22cb`](https://github.com/PRQL/pyprql/commit/f8f22cb501a24bc524d9d6085f9ae2fac1b3a034)) 453 | 454 | - Bump black from 24.3.0 to 24.4.0 ([#359](https://github.com/PRQL/pyprql/pull/359), 455 | [`77103bb`](https://github.com/PRQL/pyprql/commit/77103bbccb3d33fb90c21f00343ee6a620d97333)) 456 | 457 | Signed-off-by: dependabot[bot] 458 | 459 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 460 | 461 | - Bump commitizen from 3.13.0 to 3.14.0 ([#326](https://github.com/PRQL/pyprql/pull/326), 462 | [`629af5f`](https://github.com/PRQL/pyprql/commit/629af5fe21f84e95b3ef02829805dafc6e989bec)) 463 | 464 | Signed-off-by: dependabot[bot] 465 | 466 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 467 | 468 | - Bump commitizen from 3.14.0 to 3.15.0 ([#335](https://github.com/PRQL/pyprql/pull/335), 469 | [`ac1d71d`](https://github.com/PRQL/pyprql/commit/ac1d71d6954c69c6eb20051f56ae3a0b70dcaabc)) 470 | 471 | Signed-off-by: dependabot[bot] 472 | 473 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 474 | 475 | - Bump commitizen from 3.15.0 to 3.16.0 ([#337](https://github.com/PRQL/pyprql/pull/337), 476 | [`f871092`](https://github.com/PRQL/pyprql/commit/f871092ee291fc6c8002a6703800bbf8d9b77b14)) 477 | 478 | Signed-off-by: dependabot[bot] 479 | 480 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 481 | 482 | - Bump commitizen from 3.16.0 to 3.17.0 ([#341](https://github.com/PRQL/pyprql/pull/341), 483 | [`7db0e9d`](https://github.com/PRQL/pyprql/commit/7db0e9dbcf55f68db183c9a6fa4e4c013c6f1cb2)) 484 | 485 | Signed-off-by: dependabot[bot] 486 | 487 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 488 | 489 | - Bump commitizen from 3.17.0 to 3.18.0 ([#342](https://github.com/PRQL/pyprql/pull/342), 490 | [`11e9a7f`](https://github.com/PRQL/pyprql/commit/11e9a7fc069d8f36489d328f0080cb299dd66c67)) 491 | 492 | - Bump commitizen from 3.18.0 to 3.20.0 ([#348](https://github.com/PRQL/pyprql/pull/348), 493 | [`7c0156d`](https://github.com/PRQL/pyprql/commit/7c0156dccfd005d36d3e364e18465904d48d31df)) 494 | 495 | - Bump commitizen from 3.20.0 to 3.21.3 ([#354](https://github.com/PRQL/pyprql/pull/354), 496 | [`4ea584b`](https://github.com/PRQL/pyprql/commit/4ea584b068113db825d77cde0fd6db06bf98c650)) 497 | 498 | - Bump commitizen from 3.21.3 to 3.22.0 ([#358](https://github.com/PRQL/pyprql/pull/358), 499 | [`b62eea1`](https://github.com/PRQL/pyprql/commit/b62eea16778817e2ce533630c0d61d7b2e199660)) 500 | 501 | Signed-off-by: dependabot[bot] 502 | 503 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 504 | 505 | - Bump commitizen from 3.22.0 to 3.24.0 ([#363](https://github.com/PRQL/pyprql/pull/363), 506 | [`a9aee5d`](https://github.com/PRQL/pyprql/commit/a9aee5d771748cbfe5099a13574de8c81301bc96)) 507 | 508 | Signed-off-by: dependabot[bot] 509 | 510 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 511 | 512 | - Bump coverage from 7.3.4 to 7.4.0 ([#318](https://github.com/PRQL/pyprql/pull/318), 513 | [`099a460`](https://github.com/PRQL/pyprql/commit/099a46080170105a50350c371511c2a8befddcdf)) 514 | 515 | - Bump coverage from 7.4.0 to 7.5.0 ([#368](https://github.com/PRQL/pyprql/pull/368), 516 | [`9961d25`](https://github.com/PRQL/pyprql/commit/9961d25180f5c6e2b7bdc99ad9463d1911387ac7)) 517 | 518 | - Bump duckdb-engine from 0.10.0 to 0.11.0 ([#328](https://github.com/PRQL/pyprql/pull/328), 519 | [`a8007a5`](https://github.com/PRQL/pyprql/commit/a8007a593b9bb125152d8dda66d2c71bb529c6c3)) 520 | 521 | - Bump duckdb-engine from 0.11.0 to 0.12.0 ([#365](https://github.com/PRQL/pyprql/pull/365), 522 | [`41a497c`](https://github.com/PRQL/pyprql/commit/41a497c62bb2ee92d8e6bd4ac17505ce33578449)) 523 | 524 | - Bump duckdb-engine from 0.9.5 to 0.10.0 ([#315](https://github.com/PRQL/pyprql/pull/315), 525 | [`e6dbb9d`](https://github.com/PRQL/pyprql/commit/e6dbb9d418fae893da45b53acfa57676ff81cb6e)) 526 | 527 | - Bump mypy from 1.7.1 to 1.8.0 ([#314](https://github.com/PRQL/pyprql/pull/314), 528 | [`4f5ed43`](https://github.com/PRQL/pyprql/commit/4f5ed430c79862ee7767abf72e4e5f7ad2bef8ac)) 529 | 530 | Signed-off-by: dependabot[bot] 531 | 532 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 533 | 534 | - Bump mypy from 1.8.0 to 1.9.0 ([#343](https://github.com/PRQL/pyprql/pull/343), 535 | [`072cd55`](https://github.com/PRQL/pyprql/commit/072cd55f1c5ceeefce1bd35ba03cc725413190cc)) 536 | 537 | - Bump mypy from 1.9.0 to 1.10.0 ([#370](https://github.com/PRQL/pyprql/pull/370), 538 | [`2d628ad`](https://github.com/PRQL/pyprql/commit/2d628ad67855ab50bfce59e63f234ddb5e17738c)) 539 | 540 | - Bump myst-parser from 2.0.0 to 3.0.0 ([#369](https://github.com/PRQL/pyprql/pull/369), 541 | [`03497d9`](https://github.com/PRQL/pyprql/commit/03497d994966d5a469530c44a920ab7bd254edc1)) 542 | 543 | - Bump nox from 2023.4.22 to 2024.3.2 ([#340](https://github.com/PRQL/pyprql/pull/340), 544 | [`4238b51`](https://github.com/PRQL/pyprql/commit/4238b51cf12cb8f55dba6640d43aab74ab32fe3e)) 545 | 546 | Signed-off-by: dependabot[bot] 547 | 548 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 549 | 550 | - Bump nox from 2024.3.2 to 2024.4.15 ([#361](https://github.com/PRQL/pyprql/pull/361), 551 | [`4435e75`](https://github.com/PRQL/pyprql/commit/4435e75a5efc32ba78aa9a206c815c356703631e)) 552 | 553 | Signed-off-by: dependabot[bot] 554 | 555 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 556 | 557 | - Bump pytest from 7.4.3 to 7.4.4 ([#355](https://github.com/PRQL/pyprql/pull/355), 558 | [`3ab1d21`](https://github.com/PRQL/pyprql/commit/3ab1d2103f8f61fa1e6060882bfea0d7e1de4fc5)) 559 | 560 | Signed-off-by: dependabot[bot] 561 | 562 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 563 | 564 | - Bump pytest-cov from 4.1.0 to 5.0.0 ([#350](https://github.com/PRQL/pyprql/pull/350), 565 | [`6e3a90f`](https://github.com/PRQL/pyprql/commit/6e3a90fd5790fa742e9230df0d18939b105ab02f)) 566 | 567 | Signed-off-by: dependabot[bot] 568 | 569 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 570 | 571 | - Bump pytest-regtest from 1.5.1 to 2.1.1 ([#338](https://github.com/PRQL/pyprql/pull/338), 572 | [`f0fdfc5`](https://github.com/PRQL/pyprql/commit/f0fdfc520631cd43d1abd3f5a9c1a6f558a9977c)) 573 | 574 | Signed-off-by: dependabot[bot] 575 | 576 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 577 | 578 | - Bump pytest-sugar from 0.9.7 to 1.0.0 ([#325](https://github.com/PRQL/pyprql/pull/325), 579 | [`baa099d`](https://github.com/PRQL/pyprql/commit/baa099d42a9b5f2023a9528b32f987bcbf466ac0)) 580 | 581 | Signed-off-by: dependabot[bot] 582 | 583 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 584 | 585 | - Bump python-semantic-release from 8.5.2 to 8.7.0 ([#316](https://github.com/PRQL/pyprql/pull/316), 586 | [`6d74b06`](https://github.com/PRQL/pyprql/commit/6d74b06f6b7c3655b2111ba7dbf9df08cfb0f72f)) 587 | 588 | - Bump python-semantic-release from 8.7.0 to 9.0.3 ([#330](https://github.com/PRQL/pyprql/pull/330), 589 | [`39b3e05`](https://github.com/PRQL/pyprql/commit/39b3e057e878bee65bae391b9c2708afa8455810)) 590 | 591 | Signed-off-by: dependabot[bot] 592 | 593 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 594 | 595 | - Bump python-semantic-release from 9.0.3 to 9.1.0 ([#334](https://github.com/PRQL/pyprql/pull/334), 596 | [`d4b109c`](https://github.com/PRQL/pyprql/commit/d4b109cc6bd28db354ad65bac02bc0f5cfdd787f)) 597 | 598 | - Bump python-semantic-release from 9.1.0 to 9.2.2 ([#347](https://github.com/PRQL/pyprql/pull/347), 599 | [`4336380`](https://github.com/PRQL/pyprql/commit/4336380af06a91e7903c8c0e3822aab55b0d572c)) 600 | 601 | - Bump python-semantic-release from 9.2.2 to 9.3.0 ([#349](https://github.com/PRQL/pyprql/pull/349), 602 | [`3b3d271`](https://github.com/PRQL/pyprql/commit/3b3d27130427509b666e9ae7a3c0d6eb9e9d215e)) 603 | 604 | Signed-off-by: dependabot[bot] 605 | 606 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 607 | 608 | - Bump python-semantic-release from 9.3.0 to 9.4.1 ([#356](https://github.com/PRQL/pyprql/pull/356), 609 | [`d019d57`](https://github.com/PRQL/pyprql/commit/d019d574fb44c2f6cb1dc2f535707a267e87b42e)) 610 | 611 | Signed-off-by: dependabot[bot] 612 | 613 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 614 | 615 | - Bump python-semantic-release from 9.4.1 to 9.5.0 ([#367](https://github.com/PRQL/pyprql/pull/367), 616 | [`9e1d8ca`](https://github.com/PRQL/pyprql/commit/9e1d8ca2b562b4067148a9c87853ed4f15d12c66)) 617 | 618 | - Bump ruff from 0.1.8 to 0.2.0 ([#327](https://github.com/PRQL/pyprql/pull/327), 619 | [`0cf5021`](https://github.com/PRQL/pyprql/commit/0cf5021a54d4382606855ba22ce6b9fc85845f4e)) 620 | 621 | Signed-off-by: dependabot[bot] 622 | 623 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 624 | 625 | - Bump ruff from 0.2.0 to 0.3.0 ([#339](https://github.com/PRQL/pyprql/pull/339), 626 | [`15688fb`](https://github.com/PRQL/pyprql/commit/15688fb931c92d9d3dfd9d6dca7f781136d24832)) 627 | 628 | Signed-off-by: dependabot[bot] 629 | 630 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 631 | 632 | - Bump ruff from 0.3.0 to 0.4.1 ([#364](https://github.com/PRQL/pyprql/pull/364), 633 | [`e55563a`](https://github.com/PRQL/pyprql/commit/e55563a708114c349458540592da00fe58bd3a2f)) 634 | 635 | Signed-off-by: dependabot[bot] 636 | 637 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 638 | 639 | - Bump safety from 2.3.4 to 3.1.0 ([#352](https://github.com/PRQL/pyprql/pull/352), 640 | [`17aff3c`](https://github.com/PRQL/pyprql/commit/17aff3c16b128e35566b08ef4bcea2202e464ae5)) 641 | 642 | Signed-off-by: dependabot[bot] 643 | 644 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 645 | 646 | - Bump twine from 4.0.2 to 5.0.0 ([#331](https://github.com/PRQL/pyprql/pull/331), 647 | [`be4a46a`](https://github.com/PRQL/pyprql/commit/be4a46ab90bc42e91afd9260c7d6d8b0e4690799)) 648 | 649 | Signed-off-by: dependabot[bot] 650 | 651 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 652 | 653 | - Depends on prqlc instead of prql-python, and update other dependencies 654 | ([#372](https://github.com/PRQL/pyprql/pull/372), 655 | [`5625924`](https://github.com/PRQL/pyprql/commit/56259246664794ae9aca5cdf96290a018757b8d8)) 656 | 657 | - Update Python and poetry ([#270](https://github.com/PRQL/pyprql/pull/270), 658 | [`afb61cc`](https://github.com/PRQL/pyprql/commit/afb61cc57520bb915aff3a22b79a36e7023f9b1c)) 659 | 660 | Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> 661 | 662 | ### Features 663 | 664 | - `prql` namespace for polars.DataFrame and polars.LazyFrame 665 | ([#373](https://github.com/PRQL/pyprql/pull/373), 666 | [`86a908e`](https://github.com/PRQL/pyprql/commit/86a908e2ff655aca593bd234a2e2a8148ca841a6)) 667 | 668 | 669 | ## v0.11.0 (2023-12-21) 670 | 671 | ### Build System 672 | 673 | - Update dependencies ([#296](https://github.com/PRQL/pyprql/pull/296), 674 | [`3410ce4`](https://github.com/PRQL/pyprql/commit/3410ce44fae99c10995d2921d79efd7814a9af79)) 675 | 676 | - Upgrade dependencies ([#286](https://github.com/PRQL/pyprql/pull/286), 677 | [`9905005`](https://github.com/PRQL/pyprql/commit/9905005cc7bbb4f1ef925e582dbaebc29e38cd51)) 678 | 679 | ### Chores 680 | 681 | - Bump actions/download-artifact from 3 to 4 ([#309](https://github.com/PRQL/pyprql/pull/309), 682 | [`ea4fd59`](https://github.com/PRQL/pyprql/commit/ea4fd5905927ee792027a88b2c8758fe809c7f95)) 683 | 684 | - Bump actions/setup-python from 4 to 5 ([#304](https://github.com/PRQL/pyprql/pull/304), 685 | [`0385b7f`](https://github.com/PRQL/pyprql/commit/0385b7f4cda6b280ead7c44a4aee370437d7b790)) 686 | 687 | Signed-off-by: dependabot[bot] 688 | 689 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 690 | 691 | - Bump actions/upload-artifact from 3 to 4 ([#308](https://github.com/PRQL/pyprql/pull/308), 692 | [`a2310c6`](https://github.com/PRQL/pyprql/commit/a2310c62130414d0acde53001bdc0240cfa92ea4)) 693 | 694 | - Bump black from 23.11.0 to 23.12.0 ([#307](https://github.com/PRQL/pyprql/pull/307), 695 | [`8e5aad6`](https://github.com/PRQL/pyprql/commit/8e5aad6da625446bfc8fc3b807cd999def059f1a)) 696 | 697 | Signed-off-by: dependabot[bot] 698 | 699 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 700 | 701 | - Bump commitizen from 3.12.0 to 3.13.0 ([#303](https://github.com/PRQL/pyprql/pull/303), 702 | [`26972fc`](https://github.com/PRQL/pyprql/commit/26972fcfa2b25825d0cd8c3c46cdc63e953b8b3c)) 703 | 704 | Signed-off-by: dependabot[bot] 705 | 706 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 707 | 708 | - Bump polars from 0.19.13 to 0.20.0 ([#310](https://github.com/PRQL/pyprql/pull/310), 709 | [`df7fa0b`](https://github.com/PRQL/pyprql/commit/df7fa0b60ac5bdd0baed2856d240612f7aeeb1e8)) 710 | 711 | - Bump prql-python from 0.10.1 to 0.11.0 ([#312](https://github.com/PRQL/pyprql/pull/312), 712 | [`5fae1a9`](https://github.com/PRQL/pyprql/commit/5fae1a958b670d93da890e32e33a88eba0a7143a)) 713 | 714 | Signed-off-by: dependabot[bot] 715 | 716 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 717 | 718 | - Bump pytest-xdist from 3.4.0 to 3.5.0 ([#298](https://github.com/PRQL/pyprql/pull/298), 719 | [`0b0cca6`](https://github.com/PRQL/pyprql/commit/0b0cca654a4f102eb5327dd066c7341cf8836ca5)) 720 | 721 | Signed-off-by: dependabot[bot] 722 | 723 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 724 | 725 | - Bump python-semantic-release from 8.3.0 to 8.5.0 ([#305](https://github.com/PRQL/pyprql/pull/305), 726 | [`34c3464`](https://github.com/PRQL/pyprql/commit/34c3464940f5b1c274e675e19025e869be38471f)) 727 | 728 | Signed-off-by: dependabot[bot] 729 | 730 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 731 | 732 | - Bump sphinx-rtd-theme from 1.3.0 to 2.0.0 ([#302](https://github.com/PRQL/pyprql/pull/302), 733 | [`c97350a`](https://github.com/PRQL/pyprql/commit/c97350aa056322db47d967985ff98118c9f9301d)) 734 | 735 | Signed-off-by: dependabot[bot] 736 | 737 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 738 | 739 | - Bump traitlets from 5.13.0 to 5.14.0 ([#301](https://github.com/PRQL/pyprql/pull/301), 740 | [`7195c8a`](https://github.com/PRQL/pyprql/commit/7195c8a092b304f666b35e47b308c3320335bd81)) 741 | 742 | Signed-off-by: dependabot[bot] 743 | 744 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 745 | 746 | - Remove flake8 config file ([#287](https://github.com/PRQL/pyprql/pull/287), 747 | [`d763aed`](https://github.com/PRQL/pyprql/commit/d763aed9247a71b2a7d4c004ee24017739ffc8cc)) 748 | 749 | ### Features 750 | 751 | - Update prql-python to 0.11 ([#313](https://github.com/PRQL/pyprql/pull/313), 752 | [`dfb8056`](https://github.com/PRQL/pyprql/commit/dfb80569b7745b6ee155ad5c216926a1bfba14e1)) 753 | 754 | 755 | ## v0.10.0 (2023-10-27) 756 | 757 | ### Chores 758 | 759 | - Bump actions/checkout from 3 to 4 ([#259](https://github.com/PRQL/pyprql/pull/259), 760 | [`b2c8f5f`](https://github.com/PRQL/pyprql/commit/b2c8f5f6f15b2f68e1d24e96a0c8cc8224acd63b)) 761 | 762 | - Bump black from 23.7.0 to 23.9.1 ([#260](https://github.com/PRQL/pyprql/pull/260), 763 | [`d68c7b8`](https://github.com/PRQL/pyprql/commit/d68c7b8dbc0468a9d0de04815dd172857b80f594)) 764 | 765 | Signed-off-by: dependabot[bot] 766 | 767 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 768 | 769 | - Bump black from 23.9.1 to 23.10.0 ([#279](https://github.com/PRQL/pyprql/pull/279), 770 | [`427f428`](https://github.com/PRQL/pyprql/commit/427f4280ed028375a92b2044f37254538e189dfe)) 771 | 772 | - Bump commitizen from 3.10.0 to 3.12.0 ([#278](https://github.com/PRQL/pyprql/pull/278), 773 | [`60a0ea6`](https://github.com/PRQL/pyprql/commit/60a0ea648ccbf4081756aebae6f8baa9c1b7e4c3)) 774 | 775 | Signed-off-by: dependabot[bot] 776 | 777 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 778 | 779 | - Bump commitizen from 3.5.3 to 3.6.0 ([#238](https://github.com/PRQL/pyprql/pull/238), 780 | [`ef70e4a`](https://github.com/PRQL/pyprql/commit/ef70e4ad5c1ece520653a73548a741f49877ed08)) 781 | 782 | Signed-off-by: dependabot[bot] 783 | 784 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 785 | 786 | - Bump commitizen from 3.6.0 to 3.7.0 ([#253](https://github.com/PRQL/pyprql/pull/253), 787 | [`457a3eb`](https://github.com/PRQL/pyprql/commit/457a3eb382033be12249688678b2cd1fa8ebb001)) 788 | 789 | - Bump commitizen from 3.7.0 to 3.8.0 ([#258](https://github.com/PRQL/pyprql/pull/258), 790 | [`d64f485`](https://github.com/PRQL/pyprql/commit/d64f4858190cd70d8d1c4031082dbfbafddc68cb)) 791 | 792 | - Bump commitizen from 3.8.0 to 3.9.0 ([#263](https://github.com/PRQL/pyprql/pull/263), 793 | [`fac6c84`](https://github.com/PRQL/pyprql/commit/fac6c84d19d44b0891cee3626981f5e7e9d0798d)) 794 | 795 | Signed-off-by: dependabot[bot] 796 | 797 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 798 | 799 | - Bump commitizen from 3.9.0 to 3.10.0 ([#266](https://github.com/PRQL/pyprql/pull/266), 800 | [`4ee8a74`](https://github.com/PRQL/pyprql/commit/4ee8a74d4e2312c9449827dcf5254940c86c2907)) 801 | 802 | Signed-off-by: dependabot[bot] 803 | 804 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 805 | 806 | - Bump coverage from 7.2.7 to 7.3.0 ([#243](https://github.com/PRQL/pyprql/pull/243), 807 | [`e906b81`](https://github.com/PRQL/pyprql/commit/e906b812b0267ea29d55974976728d73187bc5d6)) 808 | 809 | - Bump jupysql from 0.8.0 to 0.9.0 ([#239](https://github.com/PRQL/pyprql/pull/239), 810 | [`368414d`](https://github.com/PRQL/pyprql/commit/368414dc6e06c90e05d8fecc54eada9ef7948dc9)) 811 | 812 | Signed-off-by: dependabot[bot] 813 | 814 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 815 | 816 | Co-authored-by: Maximilian Roos 817 | 818 | Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 819 | 820 | - Bump jupysql from 0.9.0 to 0.10.0 ([#250](https://github.com/PRQL/pyprql/pull/250), 821 | [`b09bf36`](https://github.com/PRQL/pyprql/commit/b09bf368dceb4c4a0b3170223fd451f23217e548)) 822 | 823 | - Bump mypy from 1.4.1 to 1.5.0 ([#242](https://github.com/PRQL/pyprql/pull/242), 824 | [`579fe88`](https://github.com/PRQL/pyprql/commit/579fe8810440123f58d013eefbf199009adaac29)) 825 | 826 | Signed-off-by: dependabot[bot] 827 | 828 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 829 | 830 | - Bump mypy from 1.5.0 to 1.6.0 ([#274](https://github.com/PRQL/pyprql/pull/274), 831 | [`31dabd3`](https://github.com/PRQL/pyprql/commit/31dabd3678caff10ca2fbbfcaeb568efa152b33f)) 832 | 833 | Signed-off-by: dependabot[bot] 834 | 835 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 836 | 837 | - Bump polars from 0.18.8 to 0.19.0 ([#255](https://github.com/PRQL/pyprql/pull/255), 838 | [`ed616db`](https://github.com/PRQL/pyprql/commit/ed616dbebc5dfe5eb07817ea36bdbd90e2dbaabd)) 839 | 840 | Signed-off-by: dependabot[bot] 841 | 842 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 843 | 844 | - Bump pre-commit from 3.3.3 to 3.4.0 ([#256](https://github.com/PRQL/pyprql/pull/256), 845 | [`7d52e40`](https://github.com/PRQL/pyprql/commit/7d52e40325dbd9738b880873c78675e64fc14994)) 846 | 847 | Signed-off-by: dependabot[bot] 848 | 849 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 850 | 851 | - Bump pre-commit from 3.4.0 to 3.5.0 ([#275](https://github.com/PRQL/pyprql/pull/275), 852 | [`0885532`](https://github.com/PRQL/pyprql/commit/0885532e57d9414da2abc4cb8d210f56a180d586)) 853 | 854 | Signed-off-by: dependabot[bot] 855 | 856 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 857 | 858 | - Bump prql-python from 0.9.0 to 0.10.0 ([#283](https://github.com/PRQL/pyprql/pull/283), 859 | [`613f59f`](https://github.com/PRQL/pyprql/commit/613f59f0879712488f5730a189dd989cc6f66ff2)) 860 | 861 | - Bump python-semantic-release from 8.0.3 to 8.1.1 ([#265](https://github.com/PRQL/pyprql/pull/265), 862 | [`d9f5745`](https://github.com/PRQL/pyprql/commit/d9f57454d1bef2c75065e7d47a7df7924c794708)) 863 | 864 | Signed-off-by: dependabot[bot] 865 | 866 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 867 | 868 | - Bump python-semantic-release from 8.1.1 to 8.3.0 ([#281](https://github.com/PRQL/pyprql/pull/281), 869 | [`802b0f1`](https://github.com/PRQL/pyprql/commit/802b0f1d990e1fa6e19517c501b9f4a67f4a9238)) 870 | 871 | Signed-off-by: dependabot[bot] 872 | 873 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 874 | 875 | - Bump ruff from 0.0.270 to 0.1.0 ([#277](https://github.com/PRQL/pyprql/pull/277), 876 | [`9692afe`](https://github.com/PRQL/pyprql/commit/9692afe3f5c0625ae9c57c7526b50c43dc4fb6ac)) 877 | 878 | Signed-off-by: dependabot[bot] 879 | 880 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 881 | 882 | - Bump sphinx from 6.2.1 to 7.1.2 ([#249](https://github.com/PRQL/pyprql/pull/249), 883 | [`6e7b1c4`](https://github.com/PRQL/pyprql/commit/6e7b1c459f8844180194953b3c25caf9d19b7124)) 884 | 885 | - Bump sphinx-rtd-theme from 1.2.2 to 1.3.0 ([#248](https://github.com/PRQL/pyprql/pull/248), 886 | [`25f6687`](https://github.com/PRQL/pyprql/commit/25f6687ee0adef02b0f5b0cfbddefe0c2d2efc50)) 887 | 888 | - Bump traitlets from 5.10.0 to 5.11.2 ([#269](https://github.com/PRQL/pyprql/pull/269), 889 | [`c942b11`](https://github.com/PRQL/pyprql/commit/c942b1103d7ac5a28521b4be5c35fd9d83049dae)) 890 | 891 | Signed-off-by: dependabot[bot] 892 | 893 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 894 | 895 | - Bump traitlets from 5.11.2 to 5.12.0 ([#282](https://github.com/PRQL/pyprql/pull/282), 896 | [`79af9a7`](https://github.com/PRQL/pyprql/commit/79af9a75dd051097fb34d93748f60f308fc8cf15)) 897 | 898 | Signed-off-by: dependabot[bot] 899 | 900 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 901 | 902 | - Bump traitlets from 5.9.0 to 5.10.0 ([#262](https://github.com/PRQL/pyprql/pull/262), 903 | [`70750bd`](https://github.com/PRQL/pyprql/commit/70750bdf98b3368342a3546f60ea338da0d7694d)) 904 | 905 | Signed-off-by: dependabot[bot] 906 | 907 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 908 | 909 | - Update python version in pre-commit-config ([#271](https://github.com/PRQL/pyprql/pull/271), 910 | [`ae53ac6`](https://github.com/PRQL/pyprql/commit/ae53ac6c721791386e4fa2198737ba2cb5dfdd74)) 911 | 912 | ### Continuous Integration 913 | 914 | - Use org token for @prql-bot ([#241](https://github.com/PRQL/pyprql/pull/241), 915 | [`a9cca52`](https://github.com/PRQL/pyprql/commit/a9cca52085f5ee19c636ca0b734e3f7420e95122)) 916 | 917 | ### Features 918 | 919 | - Based on PRQL 0.10 ([#285](https://github.com/PRQL/pyprql/pull/285), 920 | [`5e9faea`](https://github.com/PRQL/pyprql/commit/5e9faea6ff4fbf3e69c64ef2c15d21e2ecb1a1b5)) 921 | 922 | 923 | ## v0.9.0 (2023-07-25) 924 | 925 | ### Chores 926 | 927 | - Bump black from 22.12.0 to 23.3.0 ([#206](https://github.com/PRQL/pyprql/pull/206), 928 | [`42a972b`](https://github.com/PRQL/pyprql/commit/42a972b08776f4f48f6cbcc0f3c00a129ce29306)) 929 | 930 | Signed-off-by: dependabot[bot] 931 | 932 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 933 | 934 | - Bump black from 23.3.0 to 23.7.0 ([#223](https://github.com/PRQL/pyprql/pull/223), 935 | [`9b3262a`](https://github.com/PRQL/pyprql/commit/9b3262aee6591e61b314f3a3e14b7dbbbc83b8c2)) 936 | 937 | Signed-off-by: dependabot[bot] 938 | 939 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 940 | 941 | - Bump commitizen from 2.42.1 to 3.2.2 ([#196](https://github.com/PRQL/pyprql/pull/196), 942 | [`7615fae`](https://github.com/PRQL/pyprql/commit/7615faecc6138db4dd85f5c903cb87c9015864e3)) 943 | 944 | Signed-off-by: dependabot[bot] 945 | 946 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 947 | 948 | - Bump commitizen from 3.2.2 to 3.3.0 ([#215](https://github.com/PRQL/pyprql/pull/215), 949 | [`713b847`](https://github.com/PRQL/pyprql/commit/713b847ea6fdbc93d862d5a1d860050f29e0d381)) 950 | 951 | - Bump commitizen from 3.3.0 to 3.4.0 ([#218](https://github.com/PRQL/pyprql/pull/218), 952 | [`bd01a7b`](https://github.com/PRQL/pyprql/commit/bd01a7b5ba4c253beb13924b312f4a80027220c2)) 953 | 954 | Signed-off-by: dependabot[bot] 955 | 956 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 957 | 958 | - Bump commitizen from 3.4.0 to 3.5.2 ([#220](https://github.com/PRQL/pyprql/pull/220), 959 | [`5143362`](https://github.com/PRQL/pyprql/commit/514336253915072edcfbf944567eb41468ba87af)) 960 | 961 | - Bump coverage from 6.5.0 to 7.2.6 ([#185](https://github.com/PRQL/pyprql/pull/185), 962 | [`083a9b5`](https://github.com/PRQL/pyprql/commit/083a9b569d53e37109cac6d232b268dc754fbfc2)) 963 | 964 | Signed-off-by: dependabot[bot] 965 | 966 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 967 | 968 | - Bump coverage from 7.2.6 to 7.2.7 ([#202](https://github.com/PRQL/pyprql/pull/202), 969 | [`838ecd6`](https://github.com/PRQL/pyprql/commit/838ecd676eb3a2b1a9a3920879b77ae2db5801e1)) 970 | 971 | Signed-off-by: dependabot[bot] 972 | 973 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 974 | 975 | - Bump dependencies ([#205](https://github.com/PRQL/pyprql/pull/205), 976 | [`22ae6ea`](https://github.com/PRQL/pyprql/commit/22ae6ea3280295581bdf02c502d89a01ab133f21)) 977 | 978 | - Bump duckdb-engine from 0.7.0 to 0.7.3 ([#197](https://github.com/PRQL/pyprql/pull/197), 979 | [`23d89e3`](https://github.com/PRQL/pyprql/commit/23d89e39eef8a35dd924f0be388715cd630b9404)) 980 | 981 | Signed-off-by: dependabot[bot] 982 | 983 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 984 | 985 | - Bump duckdb-engine from 0.7.3 to 0.9.0 ([#216](https://github.com/PRQL/pyprql/pull/216), 986 | [`f68165b`](https://github.com/PRQL/pyprql/commit/f68165b5881295fd698a08f2f2cafa99af5d3154)) 987 | 988 | Signed-off-by: dependabot[bot] 989 | 990 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 991 | 992 | - Bump ipython from 8.12.0 to 8.12.2 ([#180](https://github.com/PRQL/pyprql/pull/180), 993 | [`de5d80f`](https://github.com/PRQL/pyprql/commit/de5d80f6a8ba7fd7fe7acc58a9bb5bf1c5e0d6ce)) 994 | 995 | Signed-off-by: dependabot[bot] 996 | 997 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 998 | 999 | - Bump jupysql from 0.7.0 to 0.7.2 ([#199](https://github.com/PRQL/pyprql/pull/199), 1000 | [`6b81943`](https://github.com/PRQL/pyprql/commit/6b819439967d53bb0ddf53275fd674aead1d871c)) 1001 | 1002 | Signed-off-by: dependabot[bot] 1003 | 1004 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1005 | 1006 | - Bump jupysql from 0.7.6 to 0.8.0 ([#227](https://github.com/PRQL/pyprql/pull/227), 1007 | [`8170858`](https://github.com/PRQL/pyprql/commit/8170858eb2bee5517dae1a64c9a124d8fed10726)) 1008 | 1009 | Signed-off-by: dependabot[bot] 1010 | 1011 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1012 | 1013 | - Bump mypy from 0.982 to 1.3.0 ([#191](https://github.com/PRQL/pyprql/pull/191), 1014 | [`fc17dc3`](https://github.com/PRQL/pyprql/commit/fc17dc3caa164ecab5d821baee137417c1baa2d6)) 1015 | 1016 | Signed-off-by: dependabot[bot] 1017 | 1018 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1019 | 1020 | - Bump mypy from 1.3.0 to 1.4.0 ([#217](https://github.com/PRQL/pyprql/pull/217), 1021 | [`ccb4f8f`](https://github.com/PRQL/pyprql/commit/ccb4f8f68fec914fdb6c2214c428399564159114)) 1022 | 1023 | Signed-off-by: dependabot[bot] 1024 | 1025 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1026 | 1027 | - Bump myst-parser from 0.17.2 to 0.18.1 ([#198](https://github.com/PRQL/pyprql/pull/198), 1028 | [`1926638`](https://github.com/PRQL/pyprql/commit/19266386adb205f8415edb87ce9ac732f923d036)) 1029 | 1030 | - Bump myst-parser from 0.18.1 to 1.0.0 ([#208](https://github.com/PRQL/pyprql/pull/208), 1031 | [`8bea335`](https://github.com/PRQL/pyprql/commit/8bea33523893511f745e5b113ce1a2906ed2fd88)) 1032 | 1033 | Signed-off-by: dependabot[bot] 1034 | 1035 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1036 | 1037 | - Bump myst-parser from 1.0.0 to 2.0.0 ([#214](https://github.com/PRQL/pyprql/pull/214), 1038 | [`1c2640e`](https://github.com/PRQL/pyprql/commit/1c2640e4af16c78c27e990dd1f30971cff7baa3b)) 1039 | 1040 | Signed-off-by: dependabot[bot] 1041 | 1042 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1043 | 1044 | - Bump nox from 2022.11.21 to 2023.4.22 ([#183](https://github.com/PRQL/pyprql/pull/183), 1045 | [`657a93b`](https://github.com/PRQL/pyprql/commit/657a93b03641143d51e91a364e8a163f6f3c4922)) 1046 | 1047 | Signed-off-by: dependabot[bot] 1048 | 1049 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1050 | 1051 | - Bump pandas from 2.0.0 to 2.0.2 ([#179](https://github.com/PRQL/pyprql/pull/179), 1052 | [`207e557`](https://github.com/PRQL/pyprql/commit/207e557aa0ea9873dd61215c19d61a64feed3332)) 1053 | 1054 | Signed-off-by: dependabot[bot] 1055 | 1056 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1057 | 1058 | - Bump polars from 0.17.15 to 0.18.0 ([#201](https://github.com/PRQL/pyprql/pull/201), 1059 | [`b21dcb1`](https://github.com/PRQL/pyprql/commit/b21dcb1f066b4f197665fe5b8be66635cba4c58e)) 1060 | 1061 | Signed-off-by: dependabot[bot] 1062 | 1063 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1064 | 1065 | - Bump polars from 0.17.2 to 0.17.15 ([#187](https://github.com/PRQL/pyprql/pull/187), 1066 | [`12a70eb`](https://github.com/PRQL/pyprql/commit/12a70eb95a5a797d3a30184aa0fec3b1917bac91)) 1067 | 1068 | Signed-off-by: dependabot[bot] 1069 | 1070 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1071 | 1072 | - Bump pre-commit from 2.21.0 to 3.3.2 ([#189](https://github.com/PRQL/pyprql/pull/189), 1073 | [`e1c8b54`](https://github.com/PRQL/pyprql/commit/e1c8b54b9e409fa02993e03aa44cd766c2b6b53c)) 1074 | 1075 | - Bump prql-python from 0.8.0 to 0.8.1 ([#181](https://github.com/PRQL/pyprql/pull/181), 1076 | [`0f72f6a`](https://github.com/PRQL/pyprql/commit/0f72f6a771ecad2837477e9e373a871b4d1ae545)) 1077 | 1078 | Signed-off-by: dependabot[bot] 1079 | 1080 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1081 | 1082 | - Bump pytest from 7.1.3 to 7.3.1 ([#186](https://github.com/PRQL/pyprql/pull/186), 1083 | [`b069bcb`](https://github.com/PRQL/pyprql/commit/b069bcb4db3610afbdd50e185af158a33f70d2db)) 1084 | 1085 | Signed-off-by: dependabot[bot] 1086 | 1087 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1088 | 1089 | - Bump pytest from 7.3.1 to 7.4.0 ([#219](https://github.com/PRQL/pyprql/pull/219), 1090 | [`6258adf`](https://github.com/PRQL/pyprql/commit/6258adf8bbcc86af42d7ede54156126607c71788)) 1091 | 1092 | - Bump pytest-cov from 3.0.0 to 4.1.0 ([#190](https://github.com/PRQL/pyprql/pull/190), 1093 | [`9b6ee65`](https://github.com/PRQL/pyprql/commit/9b6ee6576498e8f1af21e5969e69e7daf18a1265)) 1094 | 1095 | - Bump pytest-testmon from 2.0.6 to 2.0.8 ([#178](https://github.com/PRQL/pyprql/pull/178), 1096 | [`b21f7d4`](https://github.com/PRQL/pyprql/commit/b21f7d46fb09c29067044008ab99890e0f1afcf6)) 1097 | 1098 | Signed-off-by: dependabot[bot] 1099 | 1100 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1101 | 1102 | - Bump pytest-xdist from 2.5.0 to 3.3.1 ([#193](https://github.com/PRQL/pyprql/pull/193), 1103 | [`20431ae`](https://github.com/PRQL/pyprql/commit/20431ae3cefac08297eefc789ff7245fbe55800c)) 1104 | 1105 | - Bump python-semantic-release from 7.33.2 to 7.34.1 1106 | ([#188](https://github.com/PRQL/pyprql/pull/188), 1107 | [`20ae03f`](https://github.com/PRQL/pyprql/commit/20ae03f7355ad8ed93b8ca5ccaa94ccf75f8b9f3)) 1108 | 1109 | Signed-off-by: dependabot[bot] 1110 | 1111 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1112 | 1113 | - Bump python-semantic-release from 7.34.1 to 7.34.2 1114 | ([#203](https://github.com/PRQL/pyprql/pull/203), 1115 | [`efad918`](https://github.com/PRQL/pyprql/commit/efad918d19f8613a81ff9257a2880e6ebe9acfbd)) 1116 | 1117 | - Bump python-semantic-release from 7.34.2 to 8.0.1 1118 | ([#226](https://github.com/PRQL/pyprql/pull/226), 1119 | [`0cf1bfb`](https://github.com/PRQL/pyprql/commit/0cf1bfbac2a44382ddad0c2711e75d4ebe3f27cc)) 1120 | 1121 | Signed-off-by: dependabot[bot] 1122 | 1123 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1124 | 1125 | - Bump ruff from 0.0.225 to 0.0.270 ([#194](https://github.com/PRQL/pyprql/pull/194), 1126 | [`986b5b6`](https://github.com/PRQL/pyprql/commit/986b5b60c73d894816a50aef601cb11418bed7f9)) 1127 | 1128 | - Bump safety from 2.3.4 to 2.3.5 ([#182](https://github.com/PRQL/pyprql/pull/182), 1129 | [`08a20aa`](https://github.com/PRQL/pyprql/commit/08a20aacfdc09624309676ef05d16fb2536a632a)) 1130 | 1131 | Signed-off-by: dependabot[bot] 1132 | 1133 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1134 | 1135 | - Bump safety from 2.3.4 to 2.3.5 ([#207](https://github.com/PRQL/pyprql/pull/207), 1136 | [`33e1e8b`](https://github.com/PRQL/pyprql/commit/33e1e8b95f8c23f0d1b38fc40a9f5932ff7e445c)) 1137 | 1138 | Signed-off-by: dependabot[bot] 1139 | 1140 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1141 | 1142 | - Bump sphinx from 4.3.2 to 4.5.0 ([#192](https://github.com/PRQL/pyprql/pull/192), 1143 | [`ed238de`](https://github.com/PRQL/pyprql/commit/ed238debf0d8eb902126e584176bd75dc2e135e2)) 1144 | 1145 | - Bump sphinx from 4.5.0 to 5.3.0 ([#204](https://github.com/PRQL/pyprql/pull/204), 1146 | [`3669a1c`](https://github.com/PRQL/pyprql/commit/3669a1cc8863b8736cda99ae5d3239cf10c2b340)) 1147 | 1148 | Signed-off-by: dependabot[bot] 1149 | 1150 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1151 | 1152 | - Bump sphinx from 5.3.0 to 6.2.1 ([#212](https://github.com/PRQL/pyprql/pull/212), 1153 | [`ca588eb`](https://github.com/PRQL/pyprql/commit/ca588ebb7a5cdd7bcfe43aca0ad29f68987af683)) 1154 | 1155 | Signed-off-by: dependabot[bot] 1156 | 1157 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1158 | 1159 | - Bump sphinx-rtd-theme from 1.2.0 to 1.2.1 ([#184](https://github.com/PRQL/pyprql/pull/184), 1160 | [`49047c2`](https://github.com/PRQL/pyprql/commit/49047c23058b806cffeb8a0b96ccfe359e7d44e6)) 1161 | 1162 | Signed-off-by: dependabot[bot] 1163 | 1164 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1165 | 1166 | - Bump xdoctest from 0.15.10 to 1.1.1 ([#195](https://github.com/PRQL/pyprql/pull/195), 1167 | [`965cc0c`](https://github.com/PRQL/pyprql/commit/965cc0cc8967d5121843111293e5fba96c0ac94a)) 1168 | 1169 | Signed-off-by: dependabot[bot] 1170 | 1171 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1172 | 1173 | ### Continuous Integration 1174 | 1175 | - Can not create github release here ([#236](https://github.com/PRQL/pyprql/pull/236), 1176 | [`f1a1a52`](https://github.com/PRQL/pyprql/commit/f1a1a52b1dbfe2ba7d3e1cdbde1385658bc38dbd)) 1177 | 1178 | - Dependabot on minor versions only ([#210](https://github.com/PRQL/pyprql/pull/210), 1179 | [`8dd8a33`](https://github.com/PRQL/pyprql/commit/8dd8a3373389b3810dcfe5dcacdcb90b22247f65)) 1180 | 1181 | - Fix artifact download path ([#237](https://github.com/PRQL/pyprql/pull/237), 1182 | [`fe29220`](https://github.com/PRQL/pyprql/commit/fe292203e4b66245483d9a19c4c50834197c0f61)) 1183 | 1184 | - Fix permission ([#235](https://github.com/PRQL/pyprql/pull/235), 1185 | [`cfbf23b`](https://github.com/PRQL/pyprql/commit/cfbf23b7f48ae37dc64b1e3605df1954bc324d87)) 1186 | 1187 | - Fix release workflow ([#234](https://github.com/PRQL/pyprql/pull/234), 1188 | [`916d77c`](https://github.com/PRQL/pyprql/commit/916d77cd72f91426467150284a4f8ff25205986f)) 1189 | 1190 | - Fix release workflow for Python Semantic Release v8 1191 | ([#231](https://github.com/PRQL/pyprql/pull/231), 1192 | [`a3b5eb2`](https://github.com/PRQL/pyprql/commit/a3b5eb22b94a9eb6fa1b4566a4e84d6bf284c067)) 1193 | 1194 | - Fix release workflow for Python Semantic Release v8 1195 | ([#232](https://github.com/PRQL/pyprql/pull/232), 1196 | [`a2c26aa`](https://github.com/PRQL/pyprql/commit/a2c26aa494111609c92c4ad78043ac237ff9d0b2)) 1197 | 1198 | - Reduce matrix size, upgrade poetry ([#209](https://github.com/PRQL/pyprql/pull/209), 1199 | [`de6c167`](https://github.com/PRQL/pyprql/commit/de6c167ecd3f236c4b51197c1a6e4e541fcd0a5e)) 1200 | 1201 | - Set dependabot for pip packages ([#177](https://github.com/PRQL/pyprql/pull/177), 1202 | [`54b5106`](https://github.com/PRQL/pyprql/commit/54b5106289b9d92f640f6e08383becf5eae62981)) 1203 | 1204 | ### Features 1205 | 1206 | - Bump prql-python from 0.8 to 0.9 ([#230](https://github.com/PRQL/pyprql/pull/230), 1207 | [`42d151c`](https://github.com/PRQL/pyprql/commit/42d151c0fd1c8a7e8294e73b8e44d8b1e94d3bbf)) 1208 | 1209 | 1210 | ## v0.8.0 (2023-04-15) 1211 | 1212 | ### Chores 1213 | 1214 | - Allow pandas 2.0 and jupysql 0.7 ([#167](https://github.com/PRQL/pyprql/pull/167), 1215 | [`6042b3f`](https://github.com/PRQL/pyprql/commit/6042b3fb910ae35307e97ed45aac893f79e6a725)) 1216 | 1217 | I think it is not necessary to specify strict dependencies here. 1218 | 1219 | ### Features 1220 | 1221 | - Autopolars support ([#170](https://github.com/PRQL/pyprql/pull/170), 1222 | [`db3edf3`](https://github.com/PRQL/pyprql/commit/db3edf34b08fca5c7129b570de02441f6c4e2c83)) 1223 | 1224 | A new feature of jupysql 0.7 1225 | 1226 | - Based on prql-python 0.8 ([#169](https://github.com/PRQL/pyprql/pull/169), 1227 | [`0e4a62f`](https://github.com/PRQL/pyprql/commit/0e4a62f086c5abe39a426ecc20ea3285b23fe4b4)) 1228 | 1229 | 1230 | ## v0.7.0 (2023-04-02) 1231 | 1232 | ### Bug Fixes 1233 | 1234 | - Fix GitHub Actions workflows and more python versions support 1235 | ([#164](https://github.com/PRQL/pyprql/pull/164), 1236 | [`0901392`](https://github.com/PRQL/pyprql/commit/0901392fe4f698acb3db6d9b9fc9b039782643ae)) 1237 | 1238 | I noticed that the checks by CI were not actually using the Python version of the matrix, so I'm 1239 | fixing that. 1240 | 1241 | I'm also fixing other errors discovered using actionlint and remove nonworking codecov step. 1242 | 1243 | - Fix python versions ([#165](https://github.com/PRQL/pyprql/pull/165), 1244 | [`fb70408`](https://github.com/PRQL/pyprql/commit/fb70408e183f4d94c103200362702f1274dd4c92)) 1245 | 1246 | IPython is not supporting python 3.7 1247 | 1248 | - **magic**: Support `.prql` file with the `--file` arg option 1249 | ([#158](https://github.com/PRQL/pyprql/pull/158), 1250 | [`98dfcab`](https://github.com/PRQL/pyprql/commit/98dfcabecef0db540c11e59fce8c2c7c667176ba)) 1251 | 1252 | ### Build System 1253 | 1254 | - Have ReadTheDocs pass ([#153](https://github.com/PRQL/pyprql/pull/153), 1255 | [`e66b40c`](https://github.com/PRQL/pyprql/commit/e66b40c2d02636ba7facdccc4cc3ec0546eb8322)) 1256 | 1257 | - Move some dependencies to dev-dependencies ([#152](https://github.com/PRQL/pyprql/pull/152), 1258 | [`9b6f2f5`](https://github.com/PRQL/pyprql/commit/9b6f2f58e9fd439495faca6523d2fc7a027e9058)) 1259 | 1260 | ### Chores 1261 | 1262 | - Depends on prql-python 0.7 ([#163](https://github.com/PRQL/pyprql/pull/163), 1263 | [`d6c82b5`](https://github.com/PRQL/pyprql/commit/d6c82b57e89d818f2e896b11162b95f5ec7186ad)) 1264 | 1265 | - Remove outdated PRQL example files ([#157](https://github.com/PRQL/pyprql/pull/157), 1266 | [`7beeb01`](https://github.com/PRQL/pyprql/commit/7beeb01758ae97a066101279fabc944d761512b8)) 1267 | 1268 | ### Documentation 1269 | 1270 | - Add `compile` function ([#154](https://github.com/PRQL/pyprql/pull/154), 1271 | [`917062e`](https://github.com/PRQL/pyprql/commit/917062e0850a96c6d7e9623abfb3f0a9c9397263)) 1272 | 1273 | And explain how this differs from `prql-python`. Closes #151. 1274 | 1275 | ### Features 1276 | 1277 | - **magic**: Add `dryrun` config option to only print SQL output 1278 | ([#159](https://github.com/PRQL/pyprql/pull/159), 1279 | [`b5a602f`](https://github.com/PRQL/pyprql/commit/b5a602f2873c43666b6fed0d4423270c27e0f484)) 1280 | 1281 | `%config PrqlMagic.dryrun=True` allows to just printing without executing output SQL. 1282 | 1283 | --------- 1284 | 1285 | Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 1286 | 1287 | - **magic**: Support PRQL query in line magic ([#160](https://github.com/PRQL/pyprql/pull/160), 1288 | [`0b0f8d8`](https://github.com/PRQL/pyprql/commit/0b0f8d87f780930d6dd8852cdcbb52353baed2da)) 1289 | 1290 | Supports execution of PRQL queries in line magic, like that. 1291 | 1292 | ```python results = %prql from p = `products.csv` | aggregate [min unitsInStock, max unitsInStock] 1293 | ``` 1294 | 1295 | This PR also changes the function that performs argument parsing from `sql.parse.magic_args` to 1296 | `IPython.core.magic_arguments.parse_argstring`. In SQL we need to use `sql.parse.magic_args` 1297 | because the comment character is `--` in SQL. In PRQL, we do not need to consider `--`. 1298 | `IPython.core.magic_arguments.parse_argstring` is more strict and will raise an error for 1299 | unsupported arguments such as `--foo`. 1300 | 1301 | ```default In [1]: %load_ext pyprql.magic 1302 | 1303 | In [2]: %prql --foo from a UsageError: unrecognized arguments: --foo 1304 | 1305 | ``` 1306 | 1307 | ### Refactoring 1308 | 1309 | - Remove deprecated cli module and update dependencies 1310 | ([#162](https://github.com/PRQL/pyprql/pull/162), 1311 | [`89e1199`](https://github.com/PRQL/pyprql/commit/89e11996a9f46ea6e16b07c8cba253f2d4e8341b)) 1312 | 1313 | Remove the cli module, which has been deprecated since pyprql 0.5.10 (released on PyPI on 1314 | 2022-12-12) (#93), and update dependencies. 1315 | 1316 | This PR also includes a configuration change for python-semantic-release (`major_on_zero = false`), 1317 | making the release after this disruptive change `0.7.0` instead of `1.0.0`. 1318 | 1319 | 1320 | ## v0.6.2 (2023-03-12) 1321 | 1322 | ### Bug Fixes 1323 | 1324 | - Run semantic-release via poetry run in ci ([#148](https://github.com/PRQL/pyprql/pull/148), 1325 | [`af6e753`](https://github.com/PRQL/pyprql/commit/af6e75358c66ac76bfad8ed75dc03259d0333cb5)) 1326 | 1327 | - Skip version 0.6.0 releasing and prepare for 0.6.1 1328 | ([#147](https://github.com/PRQL/pyprql/pull/147), 1329 | [`8ce14ee`](https://github.com/PRQL/pyprql/commit/8ce14eea63e5a735b7d6517e4538f1c78af9e99a)) 1330 | 1331 | ### Build System 1332 | 1333 | - Bump prql-python to 0.6.0 ([#141](https://github.com/PRQL/pyprql/pull/141), 1334 | [`0956908`](https://github.com/PRQL/pyprql/commit/09569084b3bf367a4a26de47d5bb363a04e82d96)) 1335 | 1336 | ### Chores 1337 | 1338 | - Bump codecov/codecov-action from 2 to 3 ([#143](https://github.com/PRQL/pyprql/pull/143), 1339 | [`68398bd`](https://github.com/PRQL/pyprql/commit/68398bdd13e3fc4f4e4ff4cb4e02db431007f8df)) 1340 | 1341 | Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3.
1342 | Release notes

Sourced from codecov/codecov-action's 1344 | releases.

v3.0.0

Breaking Changes

  • #689 Bump to node16 and 1346 | small fixes

Features

  • #688 Incorporate 1348 | gcov arguments for the Codecov uploader

Dependencies

  • #548 build(deps-dev): 1350 | bump jest-junit from 12.2.0 to 13.0.0
  • #603 [Snyk] Upgrade 1352 | @​actions/core from 1.5.0 to 1.6.0
  • #628 build(deps): bump 1354 | node-fetch from 2.6.1 to 3.1.1
  • #634 build(deps): bump 1356 | node-fetch from 3.1.1 to 3.2.0
  • #636 build(deps): bump 1358 | openpgp from 5.0.1 to 5.1.0
  • #652 build(deps-dev): 1360 | bump @​vercel/ncc from 0.30.0 to 0.33.3
  • #653 build(deps-dev): 1362 | bump @​types/node from 16.11.21 to 17.0.18
  • #659 build(deps-dev): 1364 | bump @​types/jest from 27.4.0 to 27.4.1
  • #667 build(deps): bump 1366 | actions/checkout from 2 to 3
  • #673 build(deps): bump 1368 | node-fetch from 3.2.0 to 3.2.3
  • #683 build(deps): bump 1370 | minimist from 1.2.5 to 1.2.6
  • #685 build(deps): bump 1372 | @​actions/github from 5.0.0 to 5.0.1
  • #681 build(deps-dev): 1374 | bump @​types/node from 17.0.18 to 17.0.23
  • #682 build(deps-dev): 1376 | bump typescript from 4.5.5 to 4.6.3
  • #676 build(deps): bump 1378 | @​actions/exec from 1.1.0 to 1.1.1
  • #675 build(deps): bump 1380 | openpgp from 5.1.0 to 5.2.1

v2.1.0

2.1.0

Features

    1381 |
  • #515 Allow 1382 | specifying version of Codecov uploader

Dependencies

  • #499 build(deps-dev): 1384 | bump @​vercel/ncc from 0.29.0 to 0.30.0
  • #508 build(deps): bump 1386 | openpgp from 5.0.0-5 to 5.0.0
  • #514 build(deps-dev): 1388 | bump @​types/node from 16.6.0 to 16.9.0

v2.0.3

2.0.3

1389 |

Fixes

  • #464 Fix wrong link in 1391 | the readme
  • #485 fix: Add override OS 1393 | and linux default to platform
  • 1394 | 1395 |

Dependencies

  • #447 build(deps): bump 1397 | openpgp from 5.0.0-4 to 5.0.0-5
  • #458 build(deps-dev): 1399 | bump eslint from 7.31.0 to 7.32.0
  • #465 build(deps-dev): 1401 | bump @​typescript-eslint/eslint-plugin from 4.28.4 to 4.29.1
  • #466 build(deps-dev): 1403 | bump @​typescript-eslint/parser from 4.28.4 to 4.29.1
  • #468 build(deps-dev): 1405 | bump @​types/jest from 26.0.24 to 27.0.0
  • #470 build(deps-dev): 1407 | bump @​types/node from 16.4.0 to 16.6.0
  • #472 build(deps): bump 1409 | path-parse from 1.0.6 to 1.0.7
  • #473 build(deps-dev): 1411 | bump @​types/jest from 27.0.0 to 27.0.1
1412 |

... (truncated)

Changelog 1413 |

Sourced from codecov/codecov-action's 1415 | changelog.

3.1.1

Fixes

  • #661 Update deprecation 1417 | warning
  • #593 1418 | Create codeql-analysis.yml
  • #712 README: fix 1420 | typo
  • 1421 | 1422 |
  • #725 fix: Remove a 1423 | blank row
  • 1424 | 1425 |
  • #726 Update 1426 | README.md with correct badge version
  • #633 Create 1428 | scorecards-analysis.yml
  • #747 fix: add more 1430 | verbosity to validation
  • 1431 | 1432 |
  • #750 Regenerate 1433 | scorecards-analysis.yml
  • #774 Switch to v3
  • 1435 |
  • #783 Fix network 1436 | entry in table
  • #791 Trim arguments after 1438 | splitting them
  • #769 Plumb failCi into 1440 | verification function.

Dependencies

  • #713 build(deps-dev): 1442 | bump typescript from 4.6.3 to 4.6.4
  • #714 build(deps): bump 1444 | node-fetch from 3.2.3 to 3.2.4
  • #724 build(deps): bump 1446 | github/codeql-action from 1 to 2
  • #717 build(deps-dev): 1448 | bump @​types/jest from 27.4.1 to 27.5.0
  • #729 build(deps-dev): 1450 | bump @​types/node from 17.0.25 to 17.0.33
  • #734 build(deps-dev): 1452 | downgrade @​types/node to 16.11.35
  • #723 build(deps): bump 1454 | actions/checkout from 2 to 3
  • #733 build(deps): bump 1456 | @​actions/github from 5.0.1 to 5.0.3
  • #732 build(deps): bump 1458 | @​actions/core from 1.6.0 to 1.8.2
  • #737 build(deps-dev): 1460 | bump @​types/node from 16.11.35 to 16.11.36
  • #749 build(deps): bump 1462 | ossf/scorecard-action from 1.0.1 to 1.1.0
  • #755 build(deps-dev): 1464 | bump typescript from 4.6.4 to 4.7.3
  • #759 build(deps-dev): 1466 | bump @​types/node from 16.11.36 to 16.11.39
  • #762 build(deps-dev): 1468 | bump @​types/node from 16.11.39 to 16.11.40
  • #746 build(deps-dev): 1470 | bump @​vercel/ncc from 0.33.4 to 0.34.0
  • #757 build(deps): bump 1472 | ossf/scorecard-action from 1.1.0 to 1.1.1
  • #760 build(deps): bump 1474 | openpgp from 5.2.1 to 5.3.0
  • #748 build(deps): bump 1476 | actions/upload-artifact from 2.3.1 to 3.1.0
  • #766 build(deps-dev): 1478 | bump typescript from 4.7.3 to 4.7.4
  • #799 build(deps): bump 1480 | openpgp from 5.3.0 to 5.4.0
  • #798 build(deps): bump 1482 | @​actions/core from 1.8.2 to 1.9.1

3.1.0

Features

    1483 |
  • #699 Incorporate 1484 | xcode arguments for the Codecov uploader

Dependencies

  • #694 build(deps-dev): 1486 | bump @​vercel/ncc from 0.33.3 to 0.33.4
  • #696 build(deps-dev): 1488 | bump @​types/node from 17.0.23 to 17.0.25
  • #698 build(deps-dev): 1490 | bump jest-junit from 13.0.0 to 13.2.0

3.0.0

Breaking Changes

    1491 |
  • #689 Bump to 1492 | node16 and small fixes

... (truncated)

1493 |
Commits
  • d9f34f8 1495 | release: update changelog and version to 3.1.1 (#828)
  • 0e9e7b4 1499 | Plumb failCi into verification function. (#769)
  • 7f20bd4 1502 | build(deps): bump @​actions/core from 1.8.2 to 1.9.1 (#798)
  • 13bc253 1505 | build(deps): bump openpgp from 5.3.0 to 5.4.0 (#799)
  • 5c0da1b 1508 | Trim arguments after splitting them (#791)
  • 68d5f6d 1511 | Fix network entry in table (#783)
  • 2a829b9 1514 | Switch to v3 (#774)
  • 8e09eaf 1517 | build(deps-dev): bump typescript from 4.7.3 to 4.7.4 (#766)
  • 39e2229 1520 | build(deps): bump actions/upload-artifact from 2.3.1 to 3.1.0 (#748)
  • b2b7703 1523 | build(deps): bump openpgp from 5.2.1 to 5.3.0 (#760)
  • Additional 1525 | commits viewable in compare 1526 | view

1527 | 1528 | [![Dependabot compatibility 1529 | score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=codecov/codecov-action&package-manager=github_actions&previous-version=2&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) 1530 | 1531 | Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can 1532 | also trigger a rebase manually by commenting `@dependabot rebase`. 1533 | 1534 | [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) 1535 | 1536 | --- 1537 | 1538 |
Dependabot commands and options
1539 | 1540 | You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this 1541 | PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it 1542 | - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and 1543 | merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will 1544 | cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this 1545 | PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You 1546 | can achieve the same result by closing it manually - `@dependabot ignore this major version` will 1547 | close this PR and stop Dependabot creating any more for this major version (unless you reopen the 1548 | PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and 1549 | stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to 1550 | it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot 1551 | creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) 1552 | 1553 |
1554 | 1555 | Signed-off-by: dependabot[bot] 1556 | 1557 | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1558 | 1559 | - Fix release workflow ([#146](https://github.com/PRQL/pyprql/pull/146), 1560 | [`3c08f42`](https://github.com/PRQL/pyprql/commit/3c08f428b976dca95a5e40ff3f5ab3659e9635b8)) 1561 | 1562 | This reverts commit 3eb119c. 1563 | 1564 | 3eb119c failed to release build due to missing Poetry. 1565 | 1566 | ### Continuous Integration 1567 | 1568 | - Allow release workflow run by hand ([#144](https://github.com/PRQL/pyprql/pull/144), 1569 | [`d756a07`](https://github.com/PRQL/pyprql/commit/d756a073208298fba4888a2519137fb69fb6edc3)) 1570 | 1571 | While PR-based releases are convenient, but manual triggering is also useful. 1572 | 1573 | --------- 1574 | 1575 | Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> 1576 | 1577 | ### Features 1578 | 1579 | - Prepare for next release (based on prql-python 0.6.0) 1580 | ([#142](https://github.com/PRQL/pyprql/pull/142), 1581 | [`05e0adf`](https://github.com/PRQL/pyprql/commit/05e0adff1bfe7b38955f7bed6afce68ffb4fa084)) 1582 | 1583 | - Support target option ([#140](https://github.com/PRQL/pyprql/pull/140), 1584 | [`393bc65`](https://github.com/PRQL/pyprql/commit/393bc65690fc4e31d863708e1564a68225c7624d)) 1585 | 1586 | 1587 | ## v0.5.14 (2023-02-08) 1588 | 1589 | ### Build System 1590 | 1591 | - Bump prql-python to 0.5.0 ([#134](https://github.com/PRQL/pyprql/pull/134), 1592 | [`08f751d`](https://github.com/PRQL/pyprql/commit/08f751d63d98cac4421faa06865567ea27e0edde)) 1593 | 1594 | - Consolidate onto ruff for linting ([#121](https://github.com/PRQL/pyprql/pull/121), 1595 | [`3c7f498`](https://github.com/PRQL/pyprql/commit/3c7f49810c942f8bef5a007897e3c634fd704452)) 1596 | 1597 | - Update dependencies ([#128](https://github.com/PRQL/pyprql/pull/128), 1598 | [`499e8e7`](https://github.com/PRQL/pyprql/commit/499e8e723875ed4d29dd2202a16a31dd99ba6c6e)) 1599 | 1600 | - Upgrade dependencies ([#124](https://github.com/PRQL/pyprql/pull/124), 1601 | [`619ab0b`](https://github.com/PRQL/pyprql/commit/619ab0b96f0403cf3a51cb777b336fb0b2fe0dc3)) 1602 | 1603 | ### Chores 1604 | 1605 | - Fix Changelog ([#115](https://github.com/PRQL/pyprql/pull/115), 1606 | [`cfba1b1`](https://github.com/PRQL/pyprql/commit/cfba1b1a407ab770684fdcdd1a24db4914af16c3)) 1607 | 1608 | I'm really not sure what's going on with semantic-release — I think it might be time to move off 1609 | it... 1610 | 1611 | ### Continuous Integration 1612 | 1613 | - Try using a bare `pytest` in CI ([#131](https://github.com/PRQL/pyprql/pull/131), 1614 | [`83c25a7`](https://github.com/PRQL/pyprql/commit/83c25a780e9527fa116d503e713fe95536f2b451)) 1615 | 1616 | - Use prql-bot account to release ([#116](https://github.com/PRQL/pyprql/pull/116), 1617 | [`10a9b73`](https://github.com/PRQL/pyprql/commit/10a9b732258c868ff57092340b2af24a25b5403f)) 1618 | 1619 | - Use PSR action ([#117](https://github.com/PRQL/pyprql/pull/117), 1620 | [`04e1eeb`](https://github.com/PRQL/pyprql/commit/04e1eebf74ee804667539adf15b859953823711e)) 1621 | 1622 | If this doesn't work, we'll disable the auto-release... 1623 | 1624 | ### Documentation 1625 | 1626 | - Fix docs build ([#118](https://github.com/PRQL/pyprql/pull/118), 1627 | [`c7e7365`](https://github.com/PRQL/pyprql/commit/c7e73656c27b7891dc61053b5cca4b64c299e555)) 1628 | 1629 | ### Features 1630 | 1631 | - Upgrade to prql-python 0.4 ([#129](https://github.com/PRQL/pyprql/pull/129), 1632 | [`ba5afa8`](https://github.com/PRQL/pyprql/commit/ba5afa80fb27b8d998c39789f110c4e1ce1904de)) 1633 | 1634 | Overhaul docs, including fixing #126 1635 | 1636 | ### Testing 1637 | 1638 | - Add ruff to pre-commit ([#120](https://github.com/PRQL/pyprql/pull/120), 1639 | [`e9fe9e0`](https://github.com/PRQL/pyprql/commit/e9fe9e0bb1c8010006b5f6aa0926254ef0b4f75c)) 1640 | 1641 | 1642 | ## v0.5.13 (2022-12-27) 1643 | 1644 | ### Build System 1645 | 1646 | - Bump version locally ([#114](https://github.com/PRQL/pyprql/pull/114), 1647 | [`6e5db20`](https://github.com/PRQL/pyprql/commit/6e5db20dd0b697a71a8bf1257bb7c7302141616d)) 1648 | 1649 | Me & semantic-release really aren't getting along well... 1650 | 1651 | ### Documentation 1652 | 1653 | - Add a demo Colab Notebook ([#113](https://github.com/PRQL/pyprql/pull/113), 1654 | [`d6fde68`](https://github.com/PRQL/pyprql/commit/d6fde683c2ac86217f5a95e2dee2c885de91ae88)) 1655 | 1656 | Still need to provide links to it 1657 | 1658 | Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 1659 | 1660 | 1661 | ## v0.5.11 (2022-12-26) 1662 | 1663 | ### Bug Fixes 1664 | 1665 | - Add py3.8-compatible typing ([#109](https://github.com/PRQL/pyprql/pull/109), 1666 | [`cb3df80`](https://github.com/PRQL/pyprql/commit/cb3df80d33895f443aa50d5585675aa79a477550)) 1667 | 1668 | This demonstrates we need tests for the magic... 1669 | 1670 | Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 1671 | 1672 | ### Build System 1673 | 1674 | - Transition to ploomber/jupysql ([#108](https://github.com/PRQL/pyprql/pull/108), 1675 | [`5042934`](https://github.com/PRQL/pyprql/commit/5042934e718342dc3550a65d9a3a3696d5533b0c)) 1676 | 1677 | Thanks a lot to @catherinedevlin for kicking off the extension! 1678 | 1679 | Because of https://github.com/catherinedevlin/ipython-sql/issues/210, it's necessary for us to 1680 | transition to a fork, but open-minded on what we depend on if things get merged upstream. 1681 | 1682 | ### Chores 1683 | 1684 | - Add changelog for 0.5.10 ([#110](https://github.com/PRQL/pyprql/pull/110), 1685 | [`5451a62`](https://github.com/PRQL/pyprql/commit/5451a62633159eb567d0fa681b99078ec2ed9997)) 1686 | 1687 | Not sure whether this is the thing that's preventing semantic-release from working... 1688 | 1689 | - Update version to 0.5.11 ([#111](https://github.com/PRQL/pyprql/pull/111), 1690 | [`711c15b`](https://github.com/PRQL/pyprql/commit/711c15b66108b91fe6095e1d9e0c3962aa11eed3)) 1691 | 1692 | Not sure why semantic-release isn't working, so doing manually 1693 | 1694 | 1695 | ## v0.5.10 (2022-12-26) 1696 | 1697 | ### Bug Fixes 1698 | 1699 | - Have Magic print dataframes nicely ([#103](https://github.com/PRQL/pyprql/pull/103), 1700 | [`620c584`](https://github.com/PRQL/pyprql/commit/620c58410095750208a437f4044d2a042776d755)) 1701 | 1702 | - **devops**: Run release workflow on merged PRs with `release` label 1703 | ([#98](https://github.com/PRQL/pyprql/pull/98), 1704 | [`73d008e`](https://github.com/PRQL/pyprql/commit/73d008e63e624a6d7e512f03324c38035458ec9b)) 1705 | 1706 | ### Chores 1707 | 1708 | - Fix flake8 ([#97](https://github.com/PRQL/pyprql/pull/97), 1709 | [`16d461e`](https://github.com/PRQL/pyprql/commit/16d461e7fd39cbd7f01e940e5aee6cb22c0346a7)) 1710 | 1711 | - More repo & docs refactoring ([#96](https://github.com/PRQL/pyprql/pull/96), 1712 | [`e289d96`](https://github.com/PRQL/pyprql/commit/e289d960ee7c1755c0386a35bdad2059a06eece9)) 1713 | 1714 | - **devops**: Cancel previous tests on a later commit 1715 | ([#101](https://github.com/PRQL/pyprql/pull/101), 1716 | [`e363ea2`](https://github.com/PRQL/pyprql/commit/e363ea2e5121c314bb5d8c59cc98b4f9c09e5e8e)) 1717 | 1718 | - **devops**: Move mypy configs out of tests into configs 1719 | ([#100](https://github.com/PRQL/pyprql/pull/100), 1720 | [`fe7cb28`](https://github.com/PRQL/pyprql/commit/fe7cb283403cc8f89718a3be02c240582b45c2e6)) 1721 | 1722 | ### Documentation 1723 | 1724 | - Clean up Readme ([#102](https://github.com/PRQL/pyprql/pull/102), 1725 | [`e161929`](https://github.com/PRQL/pyprql/commit/e161929e0665ffc662f0f71ad7d7944b43e610d2)) 1726 | 1727 | - Make capitalization consistent ([#99](https://github.com/PRQL/pyprql/pull/99), 1728 | [`2f7ef32`](https://github.com/PRQL/pyprql/commit/2f7ef32a9cf083b6b10231c73c40e935ef15e0cb)) 1729 | 1730 | Open-minded on what to use (though let's use one) -- I've been doing `PRQL` for the lang and `prql` 1731 | for the project. So taken that approach here. 1732 | 1733 | - Rationalize docs ([#95](https://github.com/PRQL/pyprql/pull/95), 1734 | [`6ffed7f`](https://github.com/PRQL/pyprql/commit/6ffed7f0820dfefa0e98f34b8ed37a39d0bd4678)) 1735 | 1736 | 1737 | ## v0.5.9 (2022-12-10) 1738 | 1739 | ### Bug Fixes 1740 | 1741 | - Release 0.5.9 ([#92](https://github.com/PRQL/pyprql/pull/92), 1742 | [`7a031f7`](https://github.com/PRQL/pyprql/commit/7a031f78c1bed6e4396e53e71d6cde6d584a1924)) 1743 | 1744 | ### Build System 1745 | 1746 | - Upgrade duckdb_engine ([#91](https://github.com/PRQL/pyprql/pull/91), 1747 | [`f480ce0`](https://github.com/PRQL/pyprql/commit/f480ce053a8c4c61b9344182f058a8e6d7b65aab)) 1748 | 1749 | - Use correct format for homepage ([#87](https://github.com/PRQL/pyprql/pull/87), 1750 | [`0d1f82a`](https://github.com/PRQL/pyprql/commit/0d1f82a80f4ea647dda0872d2625fb9674e14873)) 1751 | 1752 | ### Continuous Integration 1753 | 1754 | - Also cache the poetry install 1755 | ([`2a452b6`](https://github.com/PRQL/pyprql/commit/2a452b69d286ab97e91f1406273df2e3ef0d348a)) 1756 | 1757 | - Another simplification of GHA ([#88](https://github.com/PRQL/pyprql/pull/88), 1758 | [`244ce27`](https://github.com/PRQL/pyprql/commit/244ce27023a268a481b50174092648e2e9e74603)) 1759 | 1760 | - Fix GitHub actions ([#90](https://github.com/PRQL/pyprql/pull/90), 1761 | [`c4dd455`](https://github.com/PRQL/pyprql/commit/c4dd455049aa794a7ccf682e32b048dfb4859b9f)) 1762 | 1763 | - Move release workflow into separate workflow ([#89](https://github.com/PRQL/pyprql/pull/89), 1764 | [`4cbd417`](https://github.com/PRQL/pyprql/commit/4cbd4178405fc4caf9b2f37eb94271aea3a37dd2)) 1765 | 1766 | 1767 | ## v0.5.8 (2022-12-10) 1768 | 1769 | ### Continuous Integration 1770 | 1771 | - Upgrade more GHA dependencies ([#86](https://github.com/PRQL/pyprql/pull/86), 1772 | [`d34adda`](https://github.com/PRQL/pyprql/commit/d34adda197e40fc1c4ca806a72a2b683ba18f417)) 1773 | 1774 | 1775 | ## v0.5.7 (2022-12-10) 1776 | 1777 | ### Build System 1778 | 1779 | - Add some useful lints to pre-commit ([#83](https://github.com/PRQL/pyprql/pull/83), 1780 | [`0f3d4b1`](https://github.com/PRQL/pyprql/commit/0f3d4b154c7a5410852a3bd49de64d6d66b90aa2)) 1781 | 1782 | - Set version back to 0.5.6 ([#85](https://github.com/PRQL/pyprql/pull/85), 1783 | [`ec4f28a`](https://github.com/PRQL/pyprql/commit/ec4f28a60b5b7f914ade66796e080fff50b1161f)) 1784 | 1785 | - Upgrade deps 1786 | ([`3344dba`](https://github.com/PRQL/pyprql/commit/3344dba2a154a31aeb76f13a2ad8247066ca284b)) 1787 | 1788 | Getting failures on other PRs from not having security fixes 1789 | 1790 | - Upgrade prql-python, simplify CI, remove 3.7 ([#80](https://github.com/PRQL/pyprql/pull/80), 1791 | [`3aed19e`](https://github.com/PRQL/pyprql/commit/3aed19ed4ccd5f78b2404463e7975fb42c9f43f4)) 1792 | 1793 | ### Chores 1794 | 1795 | - Do a pass of formatting etc ([#77](https://github.com/PRQL/pyprql/pull/77), 1796 | [`435fcdd`](https://github.com/PRQL/pyprql/commit/435fcdd5a4379169da1eefb8c9eb6dde2664962f)) 1797 | 1798 | ### Continuous Integration 1799 | 1800 | - Bump cache number ([#84](https://github.com/PRQL/pyprql/pull/84), 1801 | [`e9536d0`](https://github.com/PRQL/pyprql/commit/e9536d0b3a81f54ecaec9c10a5f8d724f3b99d4b)) 1802 | 1803 | Getting an issue caching dependencies, not sure if this will help, but worth trying 1804 | 1805 | - Fix release workflow ([#81](https://github.com/PRQL/pyprql/pull/81), 1806 | [`33cbc07`](https://github.com/PRQL/pyprql/commit/33cbc0741d642bdd6a4d975b20cd9b40009ab0c2)) 1807 | 1808 | - Upgrade GHA dependencies ([#82](https://github.com/PRQL/pyprql/pull/82), 1809 | [`dd823f9`](https://github.com/PRQL/pyprql/commit/dd823f92872ef9dd66fc663d13d2ff0230fc3785)) 1810 | 1811 | 1812 | ## v0.5.6 (2022-08-24) 1813 | 1814 | ### Bug Fixes 1815 | 1816 | - Updating release process ([#73](https://github.com/PRQL/pyprql/pull/73), 1817 | [`adb90ea`](https://github.com/PRQL/pyprql/commit/adb90ead8170d6ff1f91d0957b7cd331c3f4ca70)) 1818 | 1819 | * fix: Adding release notes 1820 | 1821 | 1822 | ## v0.5.5 (2022-08-24) 1823 | 1824 | 1825 | ## v0.5.4 (2022-06-27) 1826 | 1827 | ### Bug Fixes 1828 | 1829 | - Updating examples in doc ([#58](https://github.com/PRQL/pyprql/pull/58), 1830 | [`1c212e4`](https://github.com/PRQL/pyprql/commit/1c212e444249f6fdee2b9437d75ecce6e1b19bed)) 1831 | 1832 | 1833 | ## v0.5.3 (2022-06-27) 1834 | 1835 | ### Bug Fixes 1836 | 1837 | - Update docs ([#56](https://github.com/PRQL/pyprql/pull/56), 1838 | [`524079f`](https://github.com/PRQL/pyprql/commit/524079fd4e8c227b6b09985a0df33b2a705be85f)) 1839 | 1840 | * fix: Updating docs 1841 | 1842 | 1843 | ## v0.5.2 (2022-06-27) 1844 | 1845 | ### Bug Fixes 1846 | 1847 | - Fixes docs ([#55](https://github.com/PRQL/pyprql/pull/55), 1848 | [`20ba9d0`](https://github.com/PRQL/pyprql/commit/20ba9d086ca4c86840383e446b5aae5154a904fa)) 1849 | 1850 | 1851 | ## v0.5.1 (2022-06-27) 1852 | 1853 | ### Bug Fixes 1854 | 1855 | - Fixes #48, multiline input 1856 | ([`fcf7a89`](https://github.com/PRQL/pyprql/commit/fcf7a89053a97756528814c0f9627703c3840845)) 1857 | 1858 | - Fixes #48, multiline input (lint) ([#52](https://github.com/PRQL/pyprql/pull/52), 1859 | [`46201d8`](https://github.com/PRQL/pyprql/commit/46201d8c5a6d01b104447ec0f18432148fecdf87)) 1860 | 1861 | - Fixes multiline input ([#53](https://github.com/PRQL/pyprql/pull/53), 1862 | [`a5dced5`](https://github.com/PRQL/pyprql/commit/a5dced5634d9c96783b2bd8950c674d4d8ee27a1)) 1863 | 1864 | * fix: Fixes #48, multiline input (lint) 1865 | 1866 | ### Code Style 1867 | 1868 | - *****: Blacken files 1869 | ([`71a5bfe`](https://github.com/PRQL/pyprql/commit/71a5bfe893d53116123e26c74e5655396d535e0f)) 1870 | 1871 | - *****: Blacken files 1872 | ([`20f5f7e`](https://github.com/PRQL/pyprql/commit/20f5f7e1c276ca8d3bdc78db0ee45b5b44fe0cff)) 1873 | 1874 | ### Continuous Integration 1875 | 1876 | - **setup_psr**: Set gh_token 1877 | ([`7ba8317`](https://github.com/PRQL/pyprql/commit/7ba831791bea459bd8e3726e45025b1ddf38266f)) 1878 | 1879 | Sets the appropriate environment variable to allow uploads to github. 1880 | 1881 | 1882 | ## v0.5.0 (2022-05-21) 1883 | 1884 | ### Bug Fixes 1885 | 1886 | - **magic/prql.py**: Change default configurations 1887 | ([`f3a5274`](https://github.com/PRQL/pyprql/commit/f3a5274e5e72ce750bf60b7ea21d97b862a3fe45)) 1888 | 1889 | Defaults autopandas to true and displayconn to false. 1890 | 1891 | - **magic/prql.py**: Fix printing of results 1892 | ([`a53e172`](https://github.com/PRQL/pyprql/commit/a53e172962fa9db31db879f486b436732d07c854)) 1893 | 1894 | By providing an autoview parameter and manually specifying `_` as the return variable, we can ensure 1895 | that results are always accessible and always printable. 1896 | 1897 | ### Build System 1898 | 1899 | - **actions**: Update lock file 1900 | ([`44c7893`](https://github.com/PRQL/pyprql/commit/44c7893b7bc59d20d4b0ceac0b969d94ffe5da8d)) 1901 | 1902 | Bring pyproject and lock file into alignment and update cache number. 1903 | 1904 | - **poetry.lock**: Revert to v 1.1.13 1905 | ([`c24228e`](https://github.com/PRQL/pyprql/commit/c24228e2cdf4ee7c617d5f85a8762b331de70e4d)) 1906 | 1907 | Use of a local pre-release version of poetry had caused divergent formats in the lockfiles. This 1908 | should bring those back in line. 1909 | 1910 | - **pyproject.toml**: Add ipython support 1911 | ([`0422131`](https://github.com/PRQL/pyprql/commit/04221319c0c2c555c8b657239ffcd04bbf7c9cfb)) 1912 | 1913 | Adds ipython-sql and ipython as dependencies. The goal is to wrap the former and pass it parsed 1914 | prql. 1915 | 1916 | - **pyproject.toml**: Improver IPython version specification 1917 | ([`c70324b`](https://github.com/PRQL/pyprql/commit/c70324b8502cb57e411ce8a1179c2cf3c8efbe4e)) 1918 | 1919 | Allows those running more recent versions of Python to use more recent versions of IPython. 1920 | 1921 | ### Code Style 1922 | 1923 | - **magic/prql.py**: Apply lints 1924 | ([`1a47609`](https://github.com/PRQL/pyprql/commit/1a47609a0d23a66113b944fc30ba5ef105778da6)) 1925 | 1926 | Applies encessary lints to the file, while also updating format to run on Python 3.10/ 1927 | 1928 | - **magic/prql.py**: Improve boolean checks 1929 | ([`f28d5cb`](https://github.com/PRQL/pyprql/commit/f28d5cb6eb722f4d59a4db058b6ec8884c2b2fb8)) 1930 | 1931 | Empty strings are falsey while non empty strings are truth, so we can check them directly. 1932 | 1933 | ### Documentation 1934 | 1935 | - *****: Document magic 1936 | ([`2f51f92`](https://github.com/PRQL/pyprql/commit/2f51f9252be0e11a8d714f3906b0f920dd93da76)) 1937 | 1938 | Provides full Sphinx documentation for IPython/Jupyter Magic. 1939 | 1940 | - **magic**: Expand line vs cell explanation 1941 | ([`1e0da72`](https://github.com/PRQL/pyprql/commit/1e0da72056c3e447c4e60385c5423da8f8695849)) 1942 | 1943 | Expands on our different uses of line and cell magic relative to IPython-SQL, and also corrects a 1944 | few minor typos. 1945 | 1946 | - **magic/README.md**: Correct typos 1947 | ([`d555db0`](https://github.com/PRQL/pyprql/commit/d555db037c00cbcc76b57b2d820235ef540810c9)) 1948 | 1949 | ### Features 1950 | 1951 | - **magic/prql.py**: Rough working functionality 1952 | ([`df4a218`](https://github.com/PRQL/pyprql/commit/df4a218ab0a7460fd3e5bf4e10fef9777a810a7d)) 1953 | 1954 | Major changes still required. Currently assumes that line magic will only be used to set up 1955 | connection strings and options. Additionally, cell magic only returns correct results if the 1956 | results are passed to a local variable. 1957 | 1958 | - **pyproject.toml**: Add duckdb-engine 1959 | ([`e21d4b9`](https://github.com/PRQL/pyprql/commit/e21d4b9364c69ccedbbe6482fcb455ba6f10f979)) 1960 | 1961 | Allows magic to use duckdb connection strings. 1962 | 1963 | - **pyprql/magic**: Adds ipython magic 1964 | ([`2401f01`](https://github.com/PRQL/pyprql/commit/2401f0190b136b6ddb77c48159c4064b3edbe377)) 1965 | 1966 | This is a minimal working example. It will fail in many cases, namely when used as a line magic 1967 | where arguments are passed. 1968 | 1969 | 1970 | ## v0.4.3 (2022-05-05) 1971 | 1972 | ### Bug Fixes 1973 | 1974 | - *****: Merge 42 1975 | ([`6cca7e2`](https://github.com/PRQL/pyprql/commit/6cca7e21747f785172ce37e51875c7317765a3f1)) 1976 | 1977 | Moves backend to prql-python 1978 | 1979 | ### Build System 1980 | 1981 | - **pyproject.toml**: Respecify prql-python version 1982 | ([`310f731`](https://github.com/PRQL/pyprql/commit/310f731f44ccf313896e600aad2dd5e514c3616a)) 1983 | 1984 | Changes version specification to ^0 to allow for minor release updates. 1985 | 1986 | ### Code Style 1987 | 1988 | - *****: Apply lints 1989 | ([`94f4cc2`](https://github.com/PRQL/pyprql/commit/94f4cc21c811e74f5ef32202f3948581b5ea9a8f)) 1990 | 1991 | - **cli/__init__.py**: Remove whitespace 1992 | ([`7b5f9f4`](https://github.com/PRQL/pyprql/commit/7b5f9f4f063a278abf913fef546144fafa17c8c6)) 1993 | 1994 | ### Continuous Integration 1995 | 1996 | - *****: Add coverage support 1997 | ([`0b50b0a`](https://github.com/PRQL/pyprql/commit/0b50b0a9d67e5a92f5c08c21f45a7d757fde5c1a)) 1998 | 1999 | Configure rpository to CodeCov. Several small changes here: CodeCov action add to workflow, 2000 | dependencies added to pyproject.toml and noxfile, and coverage files ignored in .gitignore. 2001 | 2002 | - *****: Remove enforce_typing 2003 | ([`32b90c6`](https://github.com/PRQL/pyprql/commit/32b90c63c74ec5b3e43fe8c8baecab16afc30054)) 2004 | 2005 | Now that we are confident we can handle all necessary typing with mypy, this is no longer necessary. 2006 | 2007 | - **cicd.yml**: Refactor psr 2008 | ([`84e158b`](https://github.com/PRQL/pyprql/commit/84e158be6b053e57b924c013893f6673cf67bfa6)) 2009 | 2010 | Moves PSR to a separate action to ease maintenance 2011 | 2012 | - **setup_nox**: Fix cache number 2013 | ([`4246978`](https://github.com/PRQL/pyprql/commit/42469783732c74ef0e53f030de6409a5cac42a8c)) 2014 | 2015 | The action was not referencing the correct input cache_number, so an old cache was being used. 2016 | 2017 | ### Documentation 2018 | 2019 | - **docs**: Correct file links 2020 | ([`6eb1910`](https://github.com/PRQL/pyprql/commit/6eb19103c0b4cf6bf524c8378608c8e3cba55e0e)) 2021 | 2022 | Corrects docs structures to reflect the new test structure. 2023 | 2024 | - **README.md**: Add CodeCov coverage 2025 | ([`93f1009`](https://github.com/PRQL/pyprql/commit/93f1009ec9d7bf8e6992da5b935d5df0e4ddf006)) 2026 | 2027 | Closes #39. 2028 | 2029 | ### Refactoring 2030 | 2031 | - Adding simple tests 2032 | ([`2e68cc2`](https://github.com/PRQL/pyprql/commit/2e68cc2a6f7a8505c82504f7bfe52cbe8225fd20)) 2033 | 2034 | - Fixing type definition on Filter.fields to List[FilterLine] 2035 | ([`8797b99`](https://github.com/PRQL/pyprql/commit/8797b99c6f4e580f49ae9a3851db39c4976dbec7)) 2036 | 2037 | - *****: Apply mypy fixes 2038 | ([`fd81bd1`](https://github.com/PRQL/pyprql/commit/fd81bd150023ecb98c80638f9ba974ee2301801b)) 2039 | 2040 | Removing enforce_types revealed a large number of mypy errors that must have been formerly masked. 2041 | This commit fixes (nearly) all of those. 2042 | 2043 | - **tests**: Refactor tests 2044 | ([`d90da5c`](https://github.com/PRQL/pyprql/commit/d90da5c025803f3388ddb58ff11b3b26ca38a99a)) 2045 | 2046 | This moves the test directory to the top level. Additionally, for simplicity, it moves the tests 2047 | functions to the top level, as allowed by PyTest. 2048 | 2049 | 2050 | ## v0.4.2 (2022-04-16) 2051 | 2052 | ### Bug Fixes 2053 | 2054 | - Fixes enforce typing breaking on subscripted generics by forking and providing a flag to ignore 2055 | this non-error. 2056 | ([`cb19cbc`](https://github.com/PRQL/pyprql/commit/cb19cbc81275b291856818fd5689881007d5ee3c)) 2057 | 2058 | ### Code Style 2059 | 2060 | - *****: Blacken files 2061 | ([`9a0abfb`](https://github.com/PRQL/pyprql/commit/9a0abfb54ec7ee9f99ac352defb6ee3252d691af)) 2062 | 2063 | ### Continuous Integration 2064 | 2065 | - **noxfile.py**: Add tests to lints 2066 | ([`2eeac9b`](https://github.com/PRQL/pyprql/commit/2eeac9bc4f15ddd7e94229535a409e6ac295bc71)) 2067 | 2068 | Adds the tests directory to the CI/CD suite. Additionally, adds the flake8-pytest-style plugin for 2069 | checking tests. 2070 | 2071 | ### Documentation 2072 | 2073 | - **docs**: Add tests to the sphinx build 2074 | ([`049ff35`](https://github.com/PRQL/pyprql/commit/049ff353e37b180201228c45411713ef73f78761)) 2075 | 2076 | - **index.md**: Add docs badge to docs 2077 | ([`3029853`](https://github.com/PRQL/pyprql/commit/3029853a76dfc0952e2e2904e6ffede3019c3726)) 2078 | 2079 | Forgot to do this when adding to the README. 2080 | 2081 | - **LICENSE**: Add license 2082 | ([`7119bec`](https://github.com/PRQL/pyprql/commit/7119bec4a80a1f4b11c4134bf034d5dcf8dbca41)) 2083 | 2084 | Apache 2.0 2085 | 2086 | - **README.md**: Add badges 2087 | ([`c176d65`](https://github.com/PRQL/pyprql/commit/c176d65e22f091f8ac6db7a03a2a0745a7f37139)) 2088 | 2089 | In addition to adding badges to the README, this also applies a few cosmetic tweaks. 2090 | 2091 | - **README.md**: Add ReadTheDocs 2092 | ([`4d5404c`](https://github.com/PRQL/pyprql/commit/4d5404c6c5a34375bcb8a8472f9d18265024f471)) 2093 | 2094 | ReadTheDocs now recognises the repository; however, it will not recognise it as a repo I can create 2095 | webhooks for. So, these still aren't auto-updating. 2096 | 2097 | - **tests**: Document tests 2098 | ([`950e55d`](https://github.com/PRQL/pyprql/commit/950e55dbaef0579b7e72664d51de0cea50b7ef6b)) 2099 | 2100 | Provides short docstrings across the entire testing module. 2101 | 2102 | ### Refactoring 2103 | 2104 | - Attempting fix for new enforce-typing dependency 2105 | ([`f79a62c`](https://github.com/PRQL/pyprql/commit/f79a62c0474df2a85e00c09986634d5f797c9825)) 2106 | 2107 | - Cleaning up tests 2108 | ([`05da678`](https://github.com/PRQL/pyprql/commit/05da6782b9ba486edecb245378848c866cb78ed6)) 2109 | 2110 | - **tests**: Apply lints 2111 | ([`ddbf00f`](https://github.com/PRQL/pyprql/commit/ddbf00f68c5ebe4463d07a6a903b37fd2b592068)) 2112 | 2113 | Fix a number of typing issues within the test folder. 2114 | 2115 | 2116 | ## v0.4.1 (2022-04-14) 2117 | 2118 | ### Bug Fixes 2119 | 2120 | - Fixes #27 2121 | ([`b666dd0`](https://github.com/PRQL/pyprql/commit/b666dd03135bb209431575f5d1481e29299576cd)) 2122 | 2123 | ### Build System 2124 | 2125 | - **.gitignore**: Ignore vim session files 2126 | ([`29d1f61`](https://github.com/PRQL/pyprql/commit/29d1f6153a4bcf1a10452e215f47f9fbc666f3a8)) 2127 | 2128 | ### Code Style 2129 | 2130 | - *****: Blacken files 2131 | ([`7c6dc37`](https://github.com/PRQL/pyprql/commit/7c6dc3743bafd39fc3f74cc7f2fa15b153933187)) 2132 | 2133 | ### Documentation 2134 | 2135 | - *****: Correct urls 2136 | ([`0622add`](https://github.com/PRQL/pyprql/commit/0622add58fdb0dcf271102ac69f4a6dc71eb2ff5)) 2137 | 2138 | Correct URLS to reflect move to prql org. 2139 | 2140 | - *****: Provide docstrings throughout 2141 | ([`c1b7b6d`](https://github.com/PRQL/pyprql/commit/c1b7b6dc18db481f8c678cf09811afa3a25d9988)) 2142 | 2143 | DOCUMENT ALL THE THINGS!!!!!! Should provide docstrings for all code, so we can get all with Sphinx. 2144 | 2145 | - **docs**: Add Sphinx support 2146 | ([`f966f34`](https://github.com/PRQL/pyprql/commit/f966f349d6c81f31f8abd87f929addb4b73d2e81)) 2147 | 2148 | Minimum working sphinx build. Some areas (namely testing) need expanded documentation. This also 2149 | adds a code of conduct and a guide for contributing. 2150 | 2151 | - **README.md**: Get those badges 2152 | ([`2547540`](https://github.com/PRQL/pyprql/commit/2547540aee2108b6c326e219e1a21bed35ca2a8d)) 2153 | 2154 | Got to be jazzy! In all seriousness, provides a useful shortcut to a lot of information. 2155 | 2156 | ### Refactoring 2157 | 2158 | - *****: Apply various lints to build docs 2159 | ([`b3d2962`](https://github.com/PRQL/pyprql/commit/b3d2962e568d70d7c0934a3b91ff0c1987ca1855)) 2160 | 2161 | 2162 | ## v0.4.0 (2022-04-11) 2163 | 2164 | ### Bug Fixes 2165 | 2166 | - Closes #20, All derives should now be in where clause 2167 | ([`c736b25`](https://github.com/PRQL/pyprql/commit/c736b25b97a3fc7b3a2f873df6860139626b38d2)) 2168 | 2169 | - Closes #21, replace_tables now available to all to_sql transformations 2170 | ([`eb12075`](https://github.com/PRQL/pyprql/commit/eb1207595af4f86df9496c1c7d441b5ab4f8b566)) 2171 | 2172 | - Final commit for fix11 2173 | ([`421fb04`](https://github.com/PRQL/pyprql/commit/421fb044b687a63547c45562193ad18c4940145e)) 2174 | 2175 | - Fix11 , use the AST in the completer. This adds support for table aliases when completing fields. 2176 | ([`9e79119`](https://github.com/PRQL/pyprql/commit/9e79119b0fd308ab5928f50e447e4623a9ed18c2)) 2177 | 2178 | - Fixes #10 typing a letter afer period was not auto completing 2179 | ([`ee8c7f5`](https://github.com/PRQL/pyprql/commit/ee8c7f57bd84e0b535441b546a96949f57280ecb)) 2180 | 2181 | - **prql.lark**: Match file names directly 2182 | ([`259763b`](https://github.com/PRQL/pyprql/commit/259763b877f9e4385c60f3a986961b9a533892df)) 2183 | 2184 | Provides a regex to directly match file names for parsing. I'm reasonably confident there is 2185 | probably an edge case, but this seems to handle most path situations I can think of. 2186 | 2187 | - **prql.lark**: Support extensions for to statement 2188 | ([`82325a6`](https://github.com/PRQL/pyprql/commit/82325a66c5d5d73e8382011fe2ca681f24914aa6)) 2189 | 2190 | file_name should be of type name to allow for extensions. 2191 | 2192 | This doesn't cover full file paths yet. Common separators (eg /, ~) still fail to parse correctly. 2193 | 2194 | - **prql.parl**: Add filename parameter 2195 | ([`f567cd6`](https://github.com/PRQL/pyprql/commit/f567cd6b0a8e2e58488ef392e3d212159ab76f2a)) 2196 | 2197 | I'd forgot to add a filename parameter when constructing the grammar. 2198 | 2199 | ### Build System 2200 | 2201 | - **pyproject.toml**: Add pandas 2202 | ([`88d988f`](https://github.com/PRQL/pyprql/commit/88d988f567c0e63f0f4964b73ddb60858ed578e8)) 2203 | 2204 | Requires a split version specification, as pandas 1.3 does not support 3.10, while pandas 1.4 does 2205 | not support 3.7 2206 | 2207 | - **pyproject.toml**: Specify numpy version 2208 | ([`8db2338`](https://github.com/PRQL/pyprql/commit/8db2338a5a311ef3d25a9e7eba91bc5db9a8cf21)) 2209 | 2210 | Specifies the numpy version to make sure we are using secure versions. The security patches require 2211 | >1.22.2, however, which is incompatible with python 3.7, so a split version specification is 2212 | givern. Security met for python >= 3.8. Note, as well, that the numpy team rate all affected 2213 | vulnerabilities very, very low. 2214 | 2215 | ### Code Style 2216 | 2217 | - *****: Apply lints 2218 | ([`f2769e9`](https://github.com/PRQL/pyprql/commit/f2769e97d32150d06d0cb9bd6b43a4794b541043)) 2219 | 2220 | ### Continuous Integration 2221 | 2222 | - **action.yml**: Add custom set-up nox 2223 | ([`da56480`](https://github.com/PRQL/pyprql/commit/da564806bf14a1bc6e10f511f0d2d62d38e02314)) 2224 | 2225 | Given that the current set up nox action is broken, we create our own, and add some additional 2226 | features, including caching of the nox install and isntallation of poetry. 2227 | 2228 | Inspired by: 2229 | https://github.com/scikit-build/scikit-build/blob/master/.github/actions/setup-nox/action.yml 2230 | 2231 | - **cicd.yml**: Correct action path 2232 | ([`ae0e7f7`](https://github.com/PRQL/pyprql/commit/ae0e7f7ab611a5be91305c0baa8d419c66010a4f)) 2233 | 2234 | - **cicd.yml**: Use custom nox action 2235 | ([`b5337e3`](https://github.com/PRQL/pyprql/commit/b5337e328325f1eb985c181a38232218a947a3cc)) 2236 | 2237 | Update our cicd action to use our personal nox composite action. 2238 | 2239 | ### Documentation 2240 | 2241 | - Adding more prql examples 2242 | ([`2e5149e`](https://github.com/PRQL/pyprql/commit/2e5149e36d167bb16d82de30676941b7c3f519a4)) 2243 | 2244 | - Adding prql examples 2245 | ([`8ae2070`](https://github.com/PRQL/pyprql/commit/8ae2070a6d07c51c5df201de4a73a7435942478f)) 2246 | 2247 | - **cli.py**: Document connect_str properly 2248 | ([`95e568d`](https://github.com/PRQL/pyprql/commit/95e568d6ba4bd581ba276290cc4dd10dff9a87f4)) 2249 | 2250 | Lints prefer init documented directly under class. 2251 | 2252 | ### Features 2253 | 2254 | - Adding code completion on table names for ':', fixes the handling of prev_selection by clearing 2255 | out on whitespace 2256 | ([`46f7676`](https://github.com/PRQL/pyprql/commit/46f7676af190d1e5d008cc9f283628a2a47304f2)) 2257 | 2258 | - Adding completion for show columns and \d+ 2259 | ([`7b7f676`](https://github.com/PRQL/pyprql/commit/7b7f6768a4519de7ac8fbdc8458b57fe35b8baf7)) 2260 | 2261 | - Adding expression parsing for complex expressions without requiring '()' 2262 | ([`855ebd0`](https://github.com/PRQL/pyprql/commit/855ebd0166e06f9d1e288c63b7e529f73e105e61)) 2263 | 2264 | - *****: Support saving to tsv 2265 | ([`5a2630f`](https://github.com/PRQL/pyprql/commit/5a2630f7314b0a2ad04333b745d870f39d083486)) 2266 | 2267 | Users can now dump to TSV files. Need to add support for reading from them as well. 2268 | 2269 | - **cli.py**: Import csv 2270 | ([`c847eb2`](https://github.com/PRQL/pyprql/commit/c847eb269b0f48889e5b625b97377283a54b1bd1)) 2271 | 2272 | If the passed connection string points to a csv, then an in-memory sqlite database is created, and 2273 | the contents of the csv are dumped to the database. This could cause performance issues with very 2274 | large databases - both from storing the database in memory, and a speed hit for using 2275 | pd.DataFrame.to_sql to dump the dataframe. However, performance seems satisfactory on reasonable 2276 | sized datasets. 2277 | 2278 | - **cli.py**: Support cli saving to csv 2279 | ([`79382c1`](https://github.com/PRQL/pyprql/commit/79382c1aef6bd0e9c7f1e4686fde84b1e11b5f6d)) 2280 | 2281 | Now, users can dump query results to csv for downstream processing. 2282 | 2283 | - **cli.py**: Support reading from tsvs 2284 | ([`d2d675b`](https://github.com/PRQL/pyprql/commit/d2d675b7f398f8b32b27117cff1d2305ee85a811)) 2285 | 2286 | Now users can read from TSVs as well! 2287 | 2288 | - **prql.py**: Adds grammar for to 2289 | ([`3899c89`](https://github.com/PRQL/pyprql/commit/3899c89fcd6dc735a2fe6a09fd488bfff0a0fb4b)) 2290 | 2291 | Borrowing from the structure used for Joins, this grammar provides a parse-able `to` clause. 2292 | Currently, it only implements a grammar for CSVs, but it could be easily expanded to support 2293 | additional filetypes. THE PARSING IS NOT HERE IMPLEMENTED. 2294 | 2295 | - **prql.py**: Parse to statements 2296 | ([`2808f26`](https://github.com/PRQL/pyprql/commit/2808f26fb13b82d3800b6e0e92f3a12733291b9e)) 2297 | 2298 | Adds to statement support to the AST, allowing for parsing of to in a pipeline. 2299 | 2300 | ### Refactoring 2301 | 2302 | - Allowing for order named arg on sort placeable anywhere 2303 | ([`5fd0c1f`](https://github.com/PRQL/pyprql/commit/5fd0c1f92fe0f3021de369cfaa7b905ffcb90a68)) 2304 | 2305 | - Clean up 2306 | ([`559dab1`](https://github.com/PRQL/pyprql/commit/559dab108e9069a053306702cd97395dccee0834)) 2307 | 2308 | - Fixes #24, had junk data in the database causing weird results 2309 | ([`f2d6058`](https://github.com/PRQL/pyprql/commit/f2d6058309be6878d0c30bd9ffc7de79128651cc)) 2310 | 2311 | - Updating grammar to not require () around expressions 2312 | ([`3a6852a`](https://github.com/PRQL/pyprql/commit/3a6852a3d219e9b80bcc637d90783d95a906e855)) 2313 | 2314 | - *****: Improve CLI structure 2315 | ([`bc9bb72`](https://github.com/PRQL/pyprql/commit/bc9bb72a20ca5119203cf02d404a618c847f9a85)) 2316 | 2317 | Move logic for running CLI into __init__, while providing a separate module for each of the main 2318 | components of the CLI (Lexer, Style, Completer, CLI). 2319 | 2320 | - **prql.py**: Ignore type errors in 3.7 2321 | ([`043e96c`](https://github.com/PRQL/pyprql/commit/043e96c4a34a2154d26158b8e7936750d1e8a2ba)) 2322 | 2323 | For some reason, some false positive type errors are thrown for 2 lines in python 3.7 only. As they 2324 | pass in >= 3.8 and are definitely not errors, they are ignored. 2325 | 2326 | ### Testing 2327 | 2328 | - **test_grammar.py**: Add unit tests for to statements 2329 | ([`e8ff715`](https://github.com/PRQL/pyprql/commit/e8ff715b1c5cc76ee5b6a19eb1672ec169b2bec1)) 2330 | 2331 | Includes a (currently) failing test for complex file names. Will need to fix this in a future 2332 | commit. 2333 | 2334 | - **test_grammar.py**: Correct index 2335 | ([`3c68f01`](https://github.com/PRQL/pyprql/commit/3c68f01f322ab5e9f8f3969c201a212d0651b75a)) 2336 | 2337 | The searched for string in the test_aggregates_grammar_nested should occur at position == 0, not > 2338 | 0. 2339 | 2340 | - **test_grammar.py**: Exapnd to test coverage 2341 | ([`0c1f06e`](https://github.com/PRQL/pyprql/commit/0c1f06eed1f06f6ca638292780ec351825007346)) 2342 | 2343 | Expands test coverage for complex file names with the to clause, using parametrisation to provide 2344 | coverage for both windows and Linux/Mac cases. 2345 | 2346 | 2347 | ## v0.3.0 (2022-04-01) 2348 | 2349 | ### Features 2350 | 2351 | - **prql.lark**: Add join aliases 2352 | ([`94a405e`](https://github.com/PRQL/pyprql/commit/94a405ee44632f378476645c4303e08e91a275ef)) 2353 | 2354 | Add necessary grammar to support aliases in "from...join..." statements. 2355 | 2356 | ### Refactoring 2357 | 2358 | - Cleaning up tests, fixing join sql generation when join_type ( probably should rename that to side 2359 | ) is None 2360 | ([`c4fec3e`](https://github.com/PRQL/pyprql/commit/c4fec3ec664133b638fce2450aceaec43f181c95)) 2361 | 2362 | 2363 | ## v0.2.5 (2022-03-29) 2364 | 2365 | ### Bug Fixes 2366 | 2367 | - **cli.py**: Match exit to [""] 2368 | ([`aa40c42`](https://github.com/PRQL/pyprql/commit/aa40c421c99ad52ee798294f1c5ebe4059352575)) 2369 | 2370 | By matching exit to a list of empty strings, we prevent a Nonetype not iterable error from 2371 | triggering on exit. 2372 | 2373 | Close #16. 2374 | 2375 | - **cli.py**: Match exit to empty list 2376 | ([`f8c04a3`](https://github.com/PRQL/pyprql/commit/f8c04a359190009d2aa121e13a3d4261aee5b7cc)) 2377 | 2378 | Previously, the completor matched exit to None. This triggered an "object not iterable error". By 2379 | matching to an empty list (obviously there will be nothing after exit, so we don't need to 2380 | retrieve possible completions), we can exit cleanly. 2381 | 2382 | - **cli.py**: Remove sql print 2383 | ([`fdf639e`](https://github.com/PRQL/pyprql/commit/fdf639e65e8522c57ea1c9400bd1c41de78833ac)) 2384 | 2385 | To prevent redundeancy, the generated SQL query is no longer printed in SQL mode only. 2386 | 2387 | Closes #14. 2388 | 2389 | 2390 | ## v0.2.4 (2022-03-29) 2391 | 2392 | ### Bug Fixes 2393 | 2394 | - **cli.py**: Append limit to select only 2395 | ([`66f1d57`](https://github.com/PRQL/pyprql/commit/66f1d57cdd3e69141383f712a2ae71c1eb34a2ec)) 2396 | 2397 | This checks the generated SQL query for SELECT before appending LIMIT. This should allow us to run 2398 | non-returning queries (like CREATE TABLE) from the SQL cli. 2399 | 2400 | See #12. 2401 | 2402 | - **cli.py**: Check for sqlalchemy error 2403 | ([`fe2c804`](https://github.com/PRQL/pyprql/commit/fe2c804470139699a3708a286167ba1c297b0aaa)) 2404 | 2405 | When executing an SQL query, this checks if a ResourceClosedError is thrown. As this is indicative 2406 | of a successful query that doesnot return (ie CREATE/UPDATE/DELETE/etc.), we can catch it and 2407 | print a null line instead of throwing the error. If the error is not generated, then we have 2408 | results, so we print them to the screen. 2409 | 2410 | Closes #12. 2411 | 2412 | - **cli.py**: Increase default limit 2413 | ([`b5e7be4`](https://github.com/PRQL/pyprql/commit/b5e7be4b574e476495367dd5af26df3633d47b38)) 2414 | 2415 | Increses the default LIMIT from 5 to 25. 2416 | 2417 | See #12. 2418 | 2419 | ### Build System 2420 | 2421 | - Adding support for python3.7 and typing.Literal 2422 | ([`143d7bc`](https://github.com/PRQL/pyprql/commit/143d7bc6d54b72d5bf458564e7a20cc4b3e110a6)) 2423 | 2424 | - Fixing lint for prql.py 2425 | ([`23f027f`](https://github.com/PRQL/pyprql/commit/23f027fcf720be2dafe294c8d8695c2b83b847ac)) 2426 | 2427 | ### Code Style 2428 | 2429 | - *****: Blacken files 2430 | ([`8a4b632`](https://github.com/PRQL/pyprql/commit/8a4b6327873b29c2c8dd0ece8f469c3c3ece62f6)) 2431 | 2432 | - *****: Blacken files 2433 | ([`2a2e247`](https://github.com/PRQL/pyprql/commit/2a2e24700fc74241362f7d92617e35d2ba0363da)) 2434 | 2435 | ### Continuous Integration 2436 | 2437 | - **cicd.yaml**: Run lints 2438 | ([`5101e21`](https://github.com/PRQL/pyprql/commit/5101e21f923c8a9a034ee0c5a346611b011e2978)) 2439 | 2440 | By error, the previous actions ran form nox session twice, instead of running lint. 2441 | 2442 | - **prql.py**: Add type ignore comment 2443 | ([`a51b3ed`](https://github.com/PRQL/pyprql/commit/a51b3edc31b135b2e4c18b4dadd56f2305c4a7aa)) 2444 | 2445 | Both clauses of the try/except block for typing literal need ignore comments to make sure they pass 2446 | on all versions. 2447 | 2448 | ### Documentation 2449 | 2450 | - *****: Add module level docstings 2451 | ([`a9d30de`](https://github.com/PRQL/pyprql/commit/a9d30de78450f24953b4e27b16532a6baa5a777f)) 2452 | 2453 | After the refactor, add module level docstrings for new __init__'s. 2454 | 2455 | - **cli.py**: Correct docstrings 2456 | ([`ee2a5f2`](https://github.com/PRQL/pyprql/commit/ee2a5f2eeee8c8ce8b5e8cdc3aad8022c591527a)) 2457 | 2458 | A few docstrings were mangled in the the refactor. This re-formats htem to meet numpy standards. 2459 | 2460 | - **prql.py**: Add annotations 2461 | ([`a03b653`](https://github.com/PRQL/pyprql/commit/a03b653590a8fd4daef26f9ae26f718498ccf75a)) 2462 | 2463 | Completes type annotations across the codebase. 2464 | 2465 | ### Refactoring 2466 | 2467 | - Refactor the grammar to use Larks Maybe, general cleanup 2468 | ([`90781e6`](https://github.com/PRQL/pyprql/commit/90781e660424c9f2497eea849eb318e77ffb61e1)) 2469 | 2470 | - Refactor the grammar to use Larks Maybe, general cleanup 2471 | ([`4f99b2c`](https://github.com/PRQL/pyprql/commit/4f99b2cdc0979f203893fcb424096db2852d2a58)) 2472 | 2473 | - **prql.py**: Clean up __init__s 2474 | ([`cfbdf35`](https://github.com/PRQL/pyprql/commit/cfbdf35a3af1792b4f32b851a5d680507946e6f0)) 2475 | 2476 | In cases where we have to define our own init methods to satisfy Lark, a data class isn't necessary. 2477 | Additionally, in cases where a data class can be used, we should prefer to use the dataclass 2478 | __post_init__ method. This commit applies this logic across the python language framework of prql. 2479 | 2480 | 2481 | ## v0.2.3 (2022-03-21) 2482 | 2483 | 2484 | ## v0.2.2 (2022-03-21) 2485 | 2486 | ### Bug Fixes 2487 | 2488 | - Fixes examples command in the cli 2489 | ([`30d2b2f`](https://github.com/PRQL/pyprql/commit/30d2b2f27e4bf64d59d64f8f4fa566a2c8111e6b)) 2490 | 2491 | - Fixes inline documentation and bottom toolbar of CLI 2492 | ([`b5d32d5`](https://github.com/PRQL/pyprql/commit/b5d32d5f0bccb131e090b63617844666e646ff6c)) 2493 | 2494 | ### Code Style 2495 | 2496 | - *****: Blacken files 2497 | ([`b1bf0a8`](https://github.com/PRQL/pyprql/commit/b1bf0a8420555728aab8aec087610edc6a1079f3)) 2498 | 2499 | 2500 | ## v0.2.1 (2022-03-21) 2501 | 2502 | ### Code Style 2503 | 2504 | - *****: Blacken files 2505 | ([`82b705c`](https://github.com/PRQL/pyprql/commit/82b705cd6aa0508f8bb1fa02229b9193db7390b9)) 2506 | 2507 | ### Documentation 2508 | 2509 | - Updating README 2510 | ([`b84e771`](https://github.com/PRQL/pyprql/commit/b84e771d242d91ef42f25492420c5bc08aef124b)) 2511 | 2512 | 2513 | ## v0.2.0 (2022-03-20) 2514 | 2515 | ### Bug Fixes 2516 | 2517 | - Changing cli name to pyprql to prevent name collision with prql proper 2518 | ([`8125fff`](https://github.com/PRQL/pyprql/commit/8125fff32bf1c351ca64825bed763f83fa88b639)) 2519 | 2520 | - Changing cli name to pyprql to prevent name collision with prql proper - fixing lint 2521 | ([`22fd6bd`](https://github.com/PRQL/pyprql/commit/22fd6bdcc22a647cc5b10533620b74fd03cd74cf)) 2522 | 2523 | - Clean-up for redistribution 2524 | ([`e8080d4`](https://github.com/PRQL/pyprql/commit/e8080d4bf8b39a2a043820a8d8f58f2070b03fd0)) 2525 | 2526 | - Fixing imports 2527 | ([`1031cce`](https://github.com/PRQL/pyprql/commit/1031cce38abdf704aec63a637ccadccd1429c670)) 2528 | 2529 | - Fixing imports for redistribution 2530 | ([`896234a`](https://github.com/PRQL/pyprql/commit/896234a288e22e922d9b89d368ed76b51ec13762)) 2531 | 2532 | ### Code Style 2533 | 2534 | - *****: Blacken files 2535 | ([`b0d539e`](https://github.com/PRQL/pyprql/commit/b0d539ed95e5ec4ac4a4757259008a78192b3cf3)) 2536 | 2537 | - *****: Blacken files 2538 | ([`cb513f9`](https://github.com/PRQL/pyprql/commit/cb513f9f727a7642444a4fbe5176e15b7da0a105)) 2539 | 2540 | - *****: Blacken files 2541 | ([`eb71617`](https://github.com/PRQL/pyprql/commit/eb71617c235f4e7dc2ea97d9345ba4cb7b062401)) 2542 | 2543 | - *****: Blacken files 2544 | ([`9e318d8`](https://github.com/PRQL/pyprql/commit/9e318d8300aef7127a886862f5319d0740deb030)) 2545 | 2546 | - *****: Blacken files 2547 | ([`aba41c5`](https://github.com/PRQL/pyprql/commit/aba41c5fe6c9d07d236994cccaf20091de2b64a1)) 2548 | 2549 | ### Features 2550 | 2551 | - Restructuring for redistribution 2552 | ([`29b75bf`](https://github.com/PRQL/pyprql/commit/29b75bf6f38adb213e4b4443672dee3dea15f388)) 2553 | 2554 | 2555 | ## v0.1.2 (2022-03-20) 2556 | 2557 | ### Build System 2558 | 2559 | - **pyproject.toml**: Add docstring packages 2560 | ([`9288d9c`](https://github.com/PRQL/pyprql/commit/9288d9c015c8f5bfb6132b7066917264fc29546c)) 2561 | 2562 | Add suport for a number of linters and testers to ensure correct docstring usage. 2563 | 2564 | ### Code Style 2565 | 2566 | - *****: Blacken files 2567 | ([`425886b`](https://github.com/PRQL/pyprql/commit/425886b94d06b97fdc85de63b363dd1fa6b69d25)) 2568 | 2569 | ### Continuous Integration 2570 | 2571 | - **.flake8**: Ignore ANN101 2572 | ([`693e720`](https://github.com/PRQL/pyprql/commit/693e720f45e88cbe8dfd7ba6590377fa6eb63051)) 2573 | 2574 | No need to type the self-parameter, and it just clutters any errors. 2575 | 2576 | - **pyproject.toml**: Activate docstring lints 2577 | ([`9ffa084`](https://github.com/PRQL/pyprql/commit/9ffa08430c3f60af3e0396adf464207cf49026e8)) 2578 | 2579 | Activates flake8-annotations, flake8-docstring, and darglint to lint docstrings. This additionally 2580 | impacts .flake8 and noxfile.py 2581 | 2582 | - **pyproject.toml**: Activate xdoctest 2583 | ([`ee0444a`](https://github.com/PRQL/pyprql/commit/ee0444a51ab021b0cacb4bf4943b390f18a10c34)) 2584 | 2585 | Adds support for xdoctest to allow testing of docstring examples, where relevant. 2586 | 2587 | ### Documentation 2588 | 2589 | - **cli.py**: Add docstrings throughout 2590 | ([`fd28c49`](https://github.com/PRQL/pyprql/commit/fd28c49f71a88b34ddac478f929142a1a33446cc)) 2591 | 2592 | - **pyprql**: Add module-level docstrings 2593 | ([`a018801`](https://github.com/PRQL/pyprql/commit/a018801b0ae35d6300d3c8b444bb88e619504b97)) 2594 | 2595 | ### Performance Improvements 2596 | 2597 | - **prql.lark**: Grammar cleanup 2598 | ([`c25980a`](https://github.com/PRQL/pyprql/commit/c25980a420d1c117a7d3a4456fffffdccc8b0038)) 2599 | 2600 | 2601 | ## v0.1.1 (2022-03-15) 2602 | 2603 | ### Bug Fixes 2604 | 2605 | - **pyproject.toml**: Change release booleans 2606 | ([`e668700`](https://github.com/PRQL/pyprql/commit/e6687007e34529b0b337ca38047b84c239b157bc)) 2607 | 2608 | It all worked, but I forgot to switch the upload bools to true first. 2609 | 2610 | 2611 | ## v0.1.0 (2022-03-15) 2612 | 2613 | ### Build System 2614 | 2615 | - **poetry.lock**: Update dependencies 2616 | ([`5070b16`](https://github.com/PRQL/pyprql/commit/5070b1698d06732311c90dbda561056eaed6c30b)) 2617 | 2618 | ### Code Style 2619 | 2620 | - *****: Blacken files 2621 | ([`8e6b68b`](https://github.com/PRQL/pyprql/commit/8e6b68b5e291b953b76008eb5ce7c43df898053d)) 2622 | 2623 | ### Continuous Integration 2624 | 2625 | - **cicd.yaml**: Use action to add 2626 | ([`41e845f`](https://github.com/PRQL/pyprql/commit/41e845fcdc8f4a8c3f15e96d1499cb447cab0be8)) 2627 | 2628 | Let's simplify - the script was not correctly pushing the changes (I think). Some googling revealed 2629 | that there was already an existing action to handle this. To ensure that the commit is properly 2630 | detedted across jobs, this also splits formatting to its own job, and makes linting, testing, and 2631 | deployment dependent on it. 2632 | 2633 | - **commit_changes.bash**: Commit blackened files 2634 | ([`28ff29e`](https://github.com/PRQL/pyprql/commit/28ff29e34094029c25e15c2517848b188e56a5ba)) 2635 | 2636 | The previous action did not check to see if any files were changed by black/isort, so changes made 2637 | were not added to the repository. Here, a smalls cript is created and run to check for changed 2638 | files and commit them if necessary. 2639 | 2640 | ### Features 2641 | 2642 | - **cli.py**: Add code for entrypoint 2643 | ([`1802938`](https://github.com/PRQL/pyprql/commit/1802938055cc6dea4167dfa60ef51d934086dfa3)) 2644 | 2645 | Though the pyproject.toml defined an entry point, this had (for some reason) not been implemented 2646 | yet. This refactors the if name == main block to a function as an entry point. 2647 | 2648 | ### Refactoring 2649 | 2650 | - **cli.py**: Correct imports 2651 | ([`caada78`](https://github.com/PRQL/pyprql/commit/caada7876c0fb8ebfe6689ff630da55e9d955bfe)) 2652 | 2653 | Found a few imports that still referenced the old project structure. These have been corrected. 2654 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## Issues 4 | 5 | If you think you've found a bug, or have an idea for a feature, let us know 6 | [here][issues]. 7 | 8 | ## Developing 9 | 10 | If you think you can fix one of the bugs, or would like to submit a new feature, 11 | then let's get coding! 12 | 13 | Once you've cloned the repository, fork it, and get your development environment 14 | set up. We use [poetry][poetry], [nox][nox], and [pre-commit][pre-commit] to 15 | handle environments, testing, and linting. Between them, they make sure that all 16 | checks run in isolated environments. If you don't have `poetry`, please see the 17 | installation instructions [here][poetry_install]. Once you have poetry, you can 18 | get set up with: 19 | 20 | ```{code-block} shell 21 | poetry install 22 | poetry run pre-commit install --install-hooks 23 | ``` 24 | 25 | Then, to run static checks, run: 26 | 27 | ```sh 28 | pre-commit run -a 29 | ``` 30 | 31 | Pre-commit will automatically run [black][black], [mypy][mypy], 32 | and ruff. When you push a change, GitHub 33 | Actions will trigger a more robust suit using Nox, including security check and 34 | automated documentation building. 35 | 36 | ### Commits 37 | 38 | We use a GitHub Action for [python-semantic-release][psr] to manage our version 39 | numbers. This automatically parses your commit messages to determine if a new 40 | release is necessary, and, if so, what kind (ie. major, minor, patch). So your 41 | commit message is important! 42 | 43 | ### Documentation & testing 44 | 45 | If you add new code, please add documentation and tests for it as well. We use 46 | [napoleon numpy][docstrings] for our docstrings, and [sphinx][sphinx] for 47 | automatic documentation. Our testing suite is [pytest][pytest]. 48 | 49 | ## Releasing 50 | 51 | pyprql uses [python-semantic-release][psr] to automate the release process. 52 | 53 | To trigger a release, in the commit message add the terms `fix:`, `perf:`, or 54 | `feat:`. 55 | 56 | The version number will get updated automatically there is no need to update 57 | them (in `pyproject.toml` and `pyprql/__init__.py`) manually. 58 | 59 | [issues]: https://github.com/prql/pyprql/issues "Issues" 60 | [poetry]: https://python-poetry.org/ "Poetry" 61 | [poetry_install]: https://python-poetry.org/docs/#installation "Poetry Installation Instructions" 62 | [nox]: https://nox.thea.codes/en/stable/ "Nox" 63 | [pre-commit]: https://pre-commit.com/ "Pre-commit" 64 | [black]: https://github.com/psf/black "Black" 65 | [mypy]: https://mypy.readthedocs.io/en/stable/index.html "Mypy" 66 | [psr]: https://github.com/relekang/python-semantic-release "Python Semantic Release" 67 | [docstrings]: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html "Numpy Napoleon Docstrings" 68 | [sphinx]: https://www.sphinx-doc.org/en/master/index.html "Sphinx" 69 | [pytest]: https://docs.pytest.org/en/7.0.x/ "pytest" 70 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, and 10 | distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by the copyright 13 | owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all other entities 16 | that control, are controlled by, or are under common control with that entity. 17 | For the purposes of this definition, "control" means (i) the power, direct or 18 | indirect, to cause the direction or management of such entity, whether by 19 | contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the 20 | outstanding CocRefreshshares, or (iii) beneficial ownership of such entity. 21 | 22 | "You" (or "Your") shall mean an individual or Legal Entity exercising 23 | permissions granted by this License. 24 | 25 | "Source" form shall mean the preferred form for making modifications, including 26 | but not limited to software source code, documentation source, and configuration 27 | files. 28 | 29 | "Object" form shall mean any form resulting from mechanical transformation or 30 | translation of a Source form, including but not limited to compiled object code, 31 | generated documentation, and conversions to other media types. 32 | 33 | "Work" shall mean the work of authorship, whether in Source or Object form, made 34 | available under the License, as indicated by a copyright notice that is included 35 | in or attached to the work (an example is provided in the Appendix below). 36 | 37 | "Derivative Works" shall mean any work, whether in Source or Object form, that 38 | is based on (or derived from) the Work and for which the editorial revisions, 39 | annotations, elaborations, or other modifications represent, as a whole, an 40 | original work of authorship. For the purposes of this License, Derivative Works 41 | shall not include works that remain separable from, or merely link (or bind by 42 | name) to the interfaces of, the Work and Derivative Works thereof. 43 | 44 | "Contribution" shall mean any work of authorship, including the original version 45 | of the Work and any modifications or additions to that Work or Derivative Works 46 | thereof, that is intentionally submitted to Licensor for inclusion in the Work 47 | by the copyright owner or by an individual or Legal Entity authorized to submit 48 | on behalf of the copyright owner. For the purposes of this definition, 49 | "submitted" means any form of electronic, verbal, or written communication sent 50 | to the Licensor or its representatives, including but not limited to 51 | communication on electronic mailing lists, source code control systems, and 52 | issue tracking systems that are managed by, or on behalf of, the Licensor for 53 | the purpose of discussing and improving the Work, but excluding communication 54 | that is conspicuously marked or otherwise designated in writing by the copyright 55 | owner as "Not a Contribution." 56 | 57 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf 58 | of whom a Contribution has been received by Licensor and subsequently 59 | incorporated within the Work. 60 | 61 | 2. Grant of Copyright License. 62 | 63 | Subject to the terms and conditions of this License, each Contributor hereby 64 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, 65 | irrevocable copyright license to reproduce, prepare Derivative Works of, 66 | publicly display, publicly perform, sublicense, and distribute the Work and such 67 | Derivative Works in Source or Object form. 68 | 69 | 3. Grant of Patent License. 70 | 71 | Subject to the terms and conditions of this License, each Contributor hereby 72 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, 73 | irrevocable (except as stated in this section) patent license to make, have 74 | made, use, offer to sell, sell, import, and otherwise transfer the Work, where 75 | such license applies only to those patent claims licensable by such Contributor 76 | that are necessarily infringed by their Contribution(s) alone or by combination 77 | of their Contribution(s) with the Work to which such Contribution(s) was 78 | submitted. If You institute patent litigation against any entity (including a 79 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a 80 | Contribution incorporated within the Work constitutes direct or contributory 81 | patent infringement, then any patent licenses granted to You under this License 82 | for that Work shall terminate as of the date such litigation is filed. 83 | 84 | 4. Redistribution. 85 | 86 | You may reproduce and distribute copies of the Work or Derivative Works thereof 87 | in any medium, with or without modifications, and in Source or Object form, 88 | provided that You meet the following conditions: 89 | 90 | You must give any other recipients of the Work or Derivative Works a copy of 91 | this License; and 92 | You must cause any modified files to carry prominent notices stating that You 93 | changed the files; and 94 | You must retain, in the Source form of any Derivative Works that You distribute, 95 | all copyright, patent, trademark, and attribution notices from the Source form 96 | of the Work, excluding those notices that do not pertain to any part of the 97 | Derivative Works; and 98 | If the Work includes a "NOTICE" text file as part of its distribution, then any 99 | Derivative Works that You distribute must include a readable copy of the 100 | attribution notices contained within such NOTICE file, excluding those notices 101 | that do not pertain to any part of the Derivative Works, in at least one of the 102 | following places: within a NOTICE text file distributed as part of the 103 | Derivative Works; within the Source form or documentation, if provided along 104 | with the Derivative Works; or, within a display generated by the Derivative 105 | Works, if and wherever such third-party notices normally appear. The contents of 106 | the NOTICE file are for informational purposes only and do not modify the 107 | License. You may add Your own attribution notices within Derivative Works that 108 | You distribute, alongside or as an addendum to the NOTICE text from the Work, 109 | provided that such additional attribution notices cannot be construed as 110 | modifying the License. 111 | You may add Your own copyright statement to Your modifications and may provide 112 | additional or different license terms and conditions for use, reproduction, or 113 | distribution of Your modifications, or for any such Derivative Works as a whole, 114 | provided Your use, reproduction, and distribution of the Work otherwise complies 115 | with the conditions stated in this License. 116 | 117 | 5. Submission of Contributions. 118 | 119 | Unless You explicitly state otherwise, any Contribution intentionally submitted 120 | for inclusion in the Work by You to the Licensor shall be under the terms and 121 | conditions of this License, without any additional terms or conditions. 122 | Notwithstanding the above, nothing herein shall supersede or modify the terms of 123 | any separate license agreement you may have executed with Licensor regarding 124 | such Contributions. 125 | 126 | 6. Trademarks. 127 | 128 | This License does not grant permission to use the trade names, trademarks, 129 | service marks, or product names of the Licensor, except as required for 130 | reasonable and customary use in describing the origin of the Work and 131 | reproducing the content of the NOTICE file. 132 | 133 | 7. Disclaimer of Warranty. 134 | 135 | Unless required by applicable law or agreed to in writing, Licensor provides the 136 | Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, 137 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, 138 | including, without limitation, any warranties or conditions of TITLE, 139 | NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are 140 | solely responsible for determining the appropriateness of using or 141 | redistributing the Work and assume any risks associated with Your exercise of 142 | permissions under this License. 143 | 144 | 8. Limitation of Liability. 145 | 146 | In no event and under no legal theory, whether in tort (including negligence), 147 | contract, or otherwise, unless required by applicable law (such as deliberate 148 | and grossly negligent acts) or agreed to in writing, shall any Contributor be 149 | liable to You for damages, including any direct, indirect, special, incidental, 150 | or consequential damages of any character arising as a result of this License or 151 | out of the use or inability to use the Work (including but not limited to 152 | damages for loss of goodwill, work stoppage, computer failure or malfunction, or 153 | any and all other commercial damages or losses), even if such Contributor has 154 | been advised of the possibility of such damages. 155 | 156 | 9. Accepting Warranty or Additional Liability. 157 | 158 | While redistributing the Work or Derivative Works thereof, You may choose to 159 | offer, and charge a fee for, acceptance of support, warranty, indemnity, or 160 | other liability obligations and/or rights consistent with this License. However, 161 | in accepting such obligations, You may act only on Your own behalf and on Your 162 | sole responsibility, not on behalf of any other Contributor, and only if You 163 | agree to indemnify, defend, and hold each Contributor harmless for any liability 164 | incurred by, or claims asserted against, such Contributor by reason of your 165 | accepting any such warranty or additional liability. 166 | 167 | END OF TERMS AND CONDITIONS 168 | 169 | APPENDIX: How to apply the Apache License to your work 170 | 171 | To apply the Apache License to your work, attach the following boilerplate 172 | notice, with the fields enclosed by brackets "[]" replaced with your own 173 | identifying information. (Don't include the brackets!) The text should be 174 | enclosed in the appropriate comment syntax for the file format. We also 175 | recommend that a file or class name and description of purpose be included on 176 | the same "printed page" as the copyright notice for easier identification within 177 | third-party archives. 178 | 179 | Copyright [yyyy] [name of copyright owner] 180 | 181 | Licensed under the Apache License, Version 2.0 (the "License"); 182 | you may not use this file except in compliance with the License. 183 | You may obtain a copy of the License at 184 | 185 | http://www.apache.org/licenses/LICENSE-2.0 186 | 187 | Unless required by applicable law or agreed to in writing, software 188 | distributed under the License is distributed on an "AS IS" BASIS, 189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 190 | See the License for the specific language governing permissions and 191 | limitations under the License. 192 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pyprql 2 | 3 | [![CI/CD](https://github.com/prql/pyprql/actions/workflows/pull-request.yaml/badge.svg?branch=main)](https://github.com/prql/pyprql/actions/workflows/pull-request.yaml) 4 | [![Documentation Status](https://readthedocs.org/projects/pyprql/badge/?version=latest)](https://pyprql.readthedocs.io/en/latest/?badge=latest) 5 | 6 | ![PyPI](https://img.shields.io/pypi/v/pyprql) 7 | ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyprql) 8 | [![Codestyle: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) 9 | 10 | 11 | 12 | pyprql contains: 13 | 14 | - pyprql.pandas_accessor — Pandas integration for PRQL 15 | - pyprql.polars_namespace — Polars integration for PRQL 16 | - pyprql.magic — IPython magic for connecting to databases using `%%prql` 17 | - pyprql.compile — An export of `prqlc`'s `compile` function 18 | 19 | For docs, check out the [pyprql docs](https://pyprql.readthedocs.io/), and the 20 | [PRQL Book][prql_docs]. 21 | 22 | ## Installation 23 | 24 | ```sh 25 | pip install pyprql 26 | ``` 27 | 28 | Or, install with optional dependencies: 29 | 30 | ```sh 31 | pip install pyprql[polars] 32 | ``` 33 | 34 | ## Usage 35 | 36 | ### Pandas integration 37 | 38 | ```python 39 | import pandas as pd 40 | import pyprql.pandas_accessor 41 | 42 | df = (...) 43 | results_df = df.prql.query("select {age, name, occupation} | filter age > 21") 44 | ``` 45 | 46 | ### Polars integration 47 | 48 | ```python 49 | import polars as pl 50 | import pyprql.polars_namespace 51 | 52 | df = (...) 53 | results_df = df.prql.query("select {age, name, occupation} | filter age > 21") 54 | ``` 55 | 56 | ### Jupyter Magic 57 | 58 | ```python 59 | In [1]: %load_ext pyprql.magic 60 | In [2]: %prql postgresql://user:password@localhost:5432/database 61 | In [3]: %%prql 62 | ...: from p 63 | ...: group categoryID ( 64 | ...: aggregate {average unitPrice} 65 | ...: ) 66 | In [4]: %%prql results << 67 | ...: from p 68 | ...: aggregate {min unitsInStock, max unitsInStock} 69 | 70 | ``` 71 | 72 | ### Compilation 73 | 74 | This library exposes `prqlc.compile`, so we can simply generate SQL: 75 | 76 | ```python 77 | import pyprql 78 | pyprql.compile("from artists | select track") 79 | print(pyprql.compile("from artists | select track")) 80 | ``` 81 | 82 | ...returns... 83 | 84 | ```sql 85 | SELECT 86 | track 87 | FROM 88 | artists 89 | ``` 90 | 91 | For context, `prqlc` in Python is the Python binding for the `prqlc` Rust crate, so only 92 | contains functions for compilation; and this library offers broader python 93 | integrations and tooling. 94 | 95 | ## Support 96 | 97 | This project was created by 98 | [@charlie-sanders](https://github.com/charlie-sanders/) & 99 | [@rbpatt2019](https://github.com/rbpatt2019) and is now maintained by the 100 | broader PRQL team. 101 | 102 | [prql_docs]: https://prql-lang.org/book 103 | -------------------------------------------------------------------------------- /docs/PRQL_Demo.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "provenance": [], 7 | "include_colab_link": true 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | }, 13 | "language_info": { 14 | "name": "python" 15 | } 16 | }, 17 | "cells": [ 18 | { 19 | "cell_type": "markdown", 20 | "metadata": { 21 | "id": "view-in-github", 22 | "colab_type": "text" 23 | }, 24 | "source": [ 25 | "\"Open" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": null, 31 | "metadata": { 32 | "id": "cFCNl1xfQUwS" 33 | }, 34 | "outputs": [], 35 | "source": [ 36 | "# Install `pyprql`\n", 37 | "!pip -q install -U pyprql" 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "source": [ 43 | " # Load the extensions\n", 44 | " %load_ext pyprql.magic\n", 45 | " %prql duckdb:///:memory:" 46 | ], 47 | "metadata": { 48 | "id": "CbgCQ9FMQpD3" 49 | }, 50 | "execution_count": null, 51 | "outputs": [] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "source": [ 56 | "# Grab some data \n", 57 | "!wget -q https://raw.githubusercontent.com/graphql-compose/graphql-compose-examples/master/examples/northwind/data/csv/products.csv" 58 | ], 59 | "metadata": { 60 | "id": "vsJKgU37RAyk" 61 | }, 62 | "execution_count": null, 63 | "outputs": [] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "source": [ 68 | "# Here's the extension working:\n", 69 | "%%prql\n", 70 | "from p = `products.csv`\n", 71 | "filter ((supplierID == 1 or supplierID == 2) and unitsOnOrder > 0)" 72 | ], 73 | "metadata": { 74 | "id": "vI1x6uYNRkmN", 75 | "colab": { 76 | "base_uri": "https://localhost:8080/", 77 | "height": 143 78 | }, 79 | "outputId": "f786b60d-86a0-4331-9fcc-6fd155139e3b" 80 | }, 81 | "execution_count": null, 82 | "outputs": [ 83 | { 84 | "output_type": "execute_result", 85 | "data": { 86 | "text/plain": [ 87 | " productID productName supplierID categoryID \\\n", 88 | "0 2 Chang 1 1 \n", 89 | "1 3 Aniseed Syrup 1 2 \n", 90 | "2 66 Louisiana Hot Spiced Okra 2 2 \n", 91 | "\n", 92 | " quantityPerUnit unitPrice unitsInStock unitsOnOrder reorderLevel \\\n", 93 | "0 24 - 12 oz bottles 19.0 17 40 25 \n", 94 | "1 12 - 550 ml bottles 10.0 13 70 25 \n", 95 | "2 24 - 8 oz jars 17.0 4 100 20 \n", 96 | "\n", 97 | " discontinued \n", 98 | "0 0 \n", 99 | "1 0 \n", 100 | "2 0 " 101 | ], 102 | "text/html": [ 103 | "\n", 104 | "
\n", 105 | "
\n", 106 | "
\n", 107 | "\n", 120 | "\n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | "
productIDproductNamesupplierIDcategoryIDquantityPerUnitunitPriceunitsInStockunitsOnOrderreorderLeveldiscontinued
02Chang1124 - 12 oz bottles19.01740250
13Aniseed Syrup1212 - 550 ml bottles10.01370250
266Louisiana Hot Spiced Okra2224 - 8 oz jars17.04100200
\n", 178 | "
\n", 179 | " \n", 189 | " \n", 190 | " \n", 227 | "\n", 228 | " \n", 252 | "
\n", 253 | "
\n", 254 | " " 255 | ] 256 | }, 257 | "metadata": {}, 258 | "execution_count": 7 259 | } 260 | ] 261 | }, 262 | { 263 | "cell_type": "code", 264 | "source": [], 265 | "metadata": { 266 | "id": "JLYFHGgT_i4s" 267 | }, 268 | "execution_count": null, 269 | "outputs": [] 270 | } 271 | ] 272 | } 273 | -------------------------------------------------------------------------------- /docs/archive/cli.md: -------------------------------------------------------------------------------- 1 | # Command Line Interface 2 | 3 | In addition to providing the main entrypoint, 4 | documented below, 5 | this module also documents 6 | the [CLI class](./cli_class.md), 7 | the [completer class](./completer.md), 8 | the [lexer class](./lexer.md), 9 | and the [styler class](./styler.md). 10 | 11 | ```{eval-rst} 12 | .. automodule:: pyprql.cli 13 | :members: 14 | :private-members: 15 | ``` 16 | 17 | ```{toctree} 18 | :hidden: 19 | :maxdepth: 3 20 | 21 | cli_class 22 | completer 23 | lexer 24 | styler 25 | ``` 26 | -------------------------------------------------------------------------------- /docs/archive/contributing.md: -------------------------------------------------------------------------------- 1 | ```{include} ../CONTRIBUTING.md 2 | ``` 3 | -------------------------------------------------------------------------------- /docs/archive/pyprql.md: -------------------------------------------------------------------------------- 1 | # Source Code 2 | 3 | Currently, the source code is divided as follows: 4 | 5 | - `magic` module that implements the PRQL IPython/Jupyer magic. 6 | See [IPython and Jupyter Magic](./magic.md). 7 | 8 | ```{toctree} 9 | :hidden: 10 | :maxdepth: 3 11 | 12 | magic 13 | ``` 14 | -------------------------------------------------------------------------------- /docs/archive/styler.md: -------------------------------------------------------------------------------- 1 | # The Pygments Styler 2 | 3 | ```{eval-rst} 4 | .. automodule:: pyprql.cli.PRQLStyle 5 | :members: 6 | :private-members: 7 | ``` 8 | -------------------------------------------------------------------------------- /docs/changelog.md: -------------------------------------------------------------------------------- 1 | ```{include} ../CHANGELOG.md 2 | ``` 3 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | """Sphinx configuration.""" 2 | 3 | import os 4 | import sys 5 | 6 | import sphinx_rtd_theme # noqa: F401 7 | 8 | sys.path.insert(0, os.path.abspath("../")) 9 | sys.path.insert(0, os.path.abspath("../pyprql/")) 10 | 11 | project = "pyprql" 12 | author = "PRQL Crew" 13 | copyright = "2022" 14 | version = "0.4.1" 15 | extensions = [ 16 | "sphinx_rtd_theme", 17 | "sphinx.ext.autodoc", 18 | "sphinx.ext.napoleon", 19 | "myst_parser", 20 | ] 21 | exclude_patterns = ["archive/**"] 22 | 23 | napoleon_google_docstrings = False 24 | napoleon_numpy_docstrings = True 25 | napoleon_use_param = False 26 | 27 | html_theme = "sphinx_rtd_theme" 28 | 29 | source_suffix = { 30 | ".rst": "restructuredtext", 31 | ".md": "markdown", 32 | } 33 | myst_heading_anchors = 2 34 | myst_enable_extensions = [ 35 | "html_admonition", 36 | "colon_fence", 37 | ] 38 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | ```{include} ../README.md 2 | 3 | ``` 4 | 5 | ```{toctree} 6 | :hidden: 7 | :maxdepth: 3 8 | 9 | magic_readme 10 | magic_api 11 | changelog 12 | ``` 13 | -------------------------------------------------------------------------------- /docs/magic_api.md: -------------------------------------------------------------------------------- 1 | # IPython & Jupyter Magic API 2 | 3 | ```{eval-rst} 4 | .. automodule:: pyprql.magic 5 | :members: 6 | :private-members: 7 | ``` 8 | 9 | ```{eval-rst} 10 | .. automodule:: pyprql.magic.prql 11 | :members: 12 | :private-members: 13 | ``` 14 | -------------------------------------------------------------------------------- /docs/magic_readme.md: -------------------------------------------------------------------------------- 1 | ```{include} ../pyprql/magic/README.md 2 | ``` 3 | -------------------------------------------------------------------------------- /noxfile.py: -------------------------------------------------------------------------------- 1 | """Nox session configuration.""" 2 | 3 | import nox 4 | from nox.sessions import Session 5 | 6 | PACKAGE: str = "pyprql" 7 | LOCATIONS: list[str] = [ 8 | PACKAGE, 9 | "noxfile.py", 10 | ] 11 | VERSIONS: list[str] = [ 12 | "3.8", 13 | "3.9", 14 | "3.10", 15 | ] 16 | 17 | nox.options.stop_on_first_error = False 18 | nox.options.reuse_existing_virtualenvs = True 19 | 20 | 21 | @nox.session(python=VERSIONS) 22 | def type(session: Session) -> None: 23 | """Type check files with mypy.""" 24 | session.run_always("poetry", "install", external=True) 25 | args = session.posargs or LOCATIONS 26 | session.run("mypy", "--show-error-codes", *args) 27 | 28 | 29 | @nox.session(python="3.10") 30 | def security(session: Session) -> None: 31 | """Check security safety.""" 32 | session.run_always("poetry", "install", external=True) 33 | session.run( 34 | "safety", 35 | "check", 36 | "--ignore=51668", 37 | "--ignore=51457", 38 | "--full-report", 39 | ) 40 | 41 | 42 | @nox.session(python=VERSIONS) 43 | def tests(session: Session) -> None: 44 | """Run the test suite with pytest.""" 45 | session.run_always("poetry", "install", external=True) 46 | args = session.posargs or [] 47 | session.run("pytest", *args) 48 | 49 | 50 | @nox.session(python="3.10") 51 | def docs(session: Session) -> None: 52 | """Build the documentation.""" 53 | session.run_always("poetry", "install", external=True) 54 | session.run("sphinx-build", "docs", "docs/_build") 55 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | authors = [ 3 | "Charlie Sanders ", 4 | "rbpatt2019 ", 5 | "PRQL Team", 6 | ] 7 | classifiers = [ 8 | "License :: OSI Approved :: Apache Software License", 9 | "Programming Language :: Python", 10 | "Programming Language :: Python :: 3.8", 11 | "Programming Language :: Python :: 3.9", 12 | "Programming Language :: Python :: 3.10", 13 | "Programming Language :: Python :: 3.11", 14 | "Programming Language :: Python :: 3.12", 15 | "Typing :: Typed", 16 | ] 17 | description = "Python extensions for PRQL" 18 | homepage = "https://prql-lang.org" 19 | license = "Apache-2.0" 20 | name = "pyprql" 21 | readme = "README.md" 22 | repository = "https://github.com/prql/pyprql" 23 | version = "0.13.0" 24 | 25 | [tool.poetry.dependencies] 26 | python = "^3.10" 27 | 28 | duckdb-engine = ">=0.7,<0.18" 29 | jupysql = ">=0.10" 30 | pandas = ">=1.5" 31 | polars = { version = ">= 0.20.23", optional = true } 32 | prqlc = ">=0.13,<0.14" 33 | traitlets = ">=5" 34 | ipython = "^8.28.0" 35 | 36 | [tool.poetry.extras] 37 | polars = ["polars"] 38 | 39 | [tool.poetry.dev-dependencies] 40 | Sphinx = "~8.1" 41 | coverage = "^7.8.0" 42 | darglint = "^1.8.1" 43 | mypy = "^1.16" 44 | myst-parser = "^4.0.0" 45 | nox = "^2025.5.1" 46 | polars = ">=0.16" 47 | pre-commit = "^4.2.0" 48 | pytest = ">8" 49 | # pytest-regtest compat https://gitlab.com/uweschmitt/pytest-regtest/-/merge_requests/9 50 | py = "1.11" 51 | pytest-clarity = "^1.0.1" 52 | pytest-cov = "^6.1.0" 53 | pytest-regtest = "*" 54 | pytest-sugar = "^1.0.0" 55 | pytest-testmon = "*" 56 | pytest-xdist = "^3.7.0" 57 | python-semantic-release = "^10.0.2" 58 | ruff = "^0.11.0" 59 | safety = "^3" 60 | sphinx-rtd-theme = "^3.0.0" 61 | twine = "^6.1.0" 62 | xdoctest = "^1.2.0" 63 | 64 | [tool.semantic_release] 65 | branch = "main" 66 | build_command = "poetry build" 67 | changelog_file = "CHANGELOG.md" 68 | major_on_zero = false 69 | upload_to_pypi = true 70 | upload_to_release = true 71 | version_toml = ["pyproject.toml:tool.poetry.version"] 72 | 73 | [tool.pytest.ini_options] 74 | addopts = """ 75 | --xdoctest 76 | """ 77 | 78 | [tool.coverage.run] 79 | branch = true 80 | source = ["pyprql"] 81 | 82 | [tool.coverage.report] 83 | show_missing = true 84 | 85 | [tool.mypy] 86 | disable_error_code = ["union-attr", 'operator'] 87 | files = "pyprql" 88 | # TODO: ideally we would list the modules that aren't yet typed 89 | ignore_missing_imports = true 90 | 91 | [build-system] 92 | build-backend = "poetry.core.masonry.api" 93 | requires = ["poetry-core>=1.3.0"] 94 | 95 | [tool.ruff] 96 | fix = true 97 | exclude = ["docs/PRQL_Demo.ipynb"] # doesn't seem to like the `%prql` magic? 98 | [tool.ruff.lint] 99 | # E402: module level import not at top of file 100 | # E501: line too long - let the formatter about that 101 | # E731: do not assign a lambda expression, use a def 102 | extend-safe-fixes = [ 103 | "TID252", # absolute imports 104 | ] 105 | ignore = ["E402", "E501", "E731", "UP007"] 106 | extend-select = [ 107 | "B", # flake8-bugbear 108 | "F", # Pyflakes 109 | "E", # Pycodestyle 110 | "W", 111 | "TID", # flake8-tidy-imports (absolute imports) 112 | "I", # isort 113 | "UP", # Pyupgrade 114 | ] 115 | -------------------------------------------------------------------------------- /pyprql/__init__.py: -------------------------------------------------------------------------------- 1 | """Source code for pyprql.""" 2 | 3 | import prqlc # noqa: F401 4 | from prqlc import compile # noqa: F401 5 | -------------------------------------------------------------------------------- /pyprql/magic/README.md: -------------------------------------------------------------------------------- 1 | # Using the IPython and Jupyter Magic 2 | 3 | Work with pandas and PRQL in an IPython terminal or Jupyter notebook. 4 | 5 | ## Implementation 6 | 7 | This is a thin wrapper around [ploomber/jupysql][jupysql] magic. Full 8 | documentation of the supported features is available at their 9 | [repository][jupysqlfeat]. Here, we document the most salient features or those 10 | where we differ. 11 | 12 | ## Usage 13 | 14 | ### Installation 15 | 16 | If you have already installed pyprql into your environment, 17 | then you should be could to go! 18 | We bundle in `IPython` and `pandas`, 19 | though you'll need to install `Jupyter` separately. 20 | If you haven't installed pyprql, 21 | that's as simple as: 22 | 23 | ```shell 24 | pip install pyprql 25 | ``` 26 | 27 | ### Set Up 28 | 29 | Open up either an `IPython` terminal or `Jupyter` notebook. First, we need to 30 | load the extension and connect to a database. 31 | 32 | ``` 33 | In [1]: %load_ext pyprql.magic 34 | 35 | ``` 36 | 37 | #### Connecting a database 38 | 39 | We have two options for connecting a database 40 | 41 | 1. Create an in-memory DB. This is the easiest way to get started. 42 | 43 | ``` 44 | In [2]: %prql duckdb:///:memory: 45 | ``` 46 | 47 | However, in-memory databases start off empty! So, we need to add some data. 48 | We have a two options: 49 | 50 | - We can easily add a [pandas][pandas] dataframe to the `DuckDB` database 51 | like so: 52 | 53 | ``` 54 | In [3]: %prql --persist df 55 | ``` 56 | 57 | where `df` is a pandas dataframe. This adds a table named `df` to the 58 | in-memory `DuckDB` instance. 59 | 60 | - Or download a CSV and query it directly, with DuckDB: 61 | 62 | ``` 63 | !wget https://raw.githubusercontent.com/graphql-compose/graphql-compose-examples/master/examples/northwind/data/csv/products.csv 64 | ``` 65 | 66 | ...and then `` from `products.csv` `` will work. 67 | 68 | 2. Connect to an existing database 69 | 70 | When connecting to a database, pass the connection string as an argument to the 71 | line magic `%prql`. The connection string needs to be in [SQLAlchemy 72 | format][conn_str], so any connection supported by `SQLAlchemy` is supported by 73 | the magic. Additional connection parameters can be passed as a dictionary using 74 | the `--connection_arguments` flag to the the `%prql` line magic. We ship with 75 | the necessary extensions to use [DuckDB][duckdb] as the backend, and here 76 | connect to an in-memory database. 77 | 78 | ### Querying 79 | 80 | Now, let's do a query! By default, `PrqlMagic` always returns the results as 81 | dataframe, and always prints the results. The results of the previous query are 82 | accessible in the `_` variable. 83 | 84 | These examples are based on the `` from `products.csv` ``example above. 85 | 86 | ``` 87 | 88 | 89 | In [4]: %%prql 90 | ...: from p = `products.csv` 91 | ...: filter supplierID == 1 92 | 93 | Done. 94 | Returning data to local variable _ 95 | productID productName supplierID categoryID quantityPerUnit unitPrice unitsInStock unitsOnOrder reorderLevel discontinued 96 | 0 1 Chai 1 1 10 boxes x 20 bags 18.0 39 0 10 0 97 | 1 2 Chang 1 1 24 - 12 oz bottles 19.0 17 40 25 0 98 | 2 3 Aniseed Syrup 1 2 12 - 550 ml bottles 10.0 13 70 25 0 99 | ``` 100 | 101 | ``` 102 | In [5]: %%prql 103 | ...: from p = `products.csv` 104 | ...: group categoryID ( 105 | ...: aggregate {average unitPrice} 106 | ...: ) 107 | 108 | Done. 109 | Returning data to local variable _ 110 | categoryID avg("unitPrice") 111 | 0 1 37.979167 112 | 1 2 23.062500 113 | 2 7 32.370000 114 | 3 6 54.006667 115 | 4 8 20.682500 116 | 5 4 28.730000 117 | 6 3 25.160000 118 | 7 5 20.250000 119 | ``` 120 | 121 | We can capture the results into a different variable like so: 122 | 123 | ``` 124 | In [6]: %%prql results << 125 | ...: from p = `products.csv` 126 | ...: aggregate {min unitsInStock, max unitsInStock} 127 | 128 | Done. 129 | Returning data to local variable results 130 | min("unitsInStock") max("unitsInStock") 131 | 0 0 125 132 | ``` 133 | 134 | Now, the output of the query is saved to `results`. 135 | 136 | We can also use a line magic to capture the results like this: 137 | 138 | ``` 139 | In [7]: results = %prql from p = `products.csv` | aggregate {min unitsInStock, max unitsInStock} 140 | ``` 141 | 142 | ## Configuration 143 | 144 | We strive to provide sane defaults; 145 | however, 146 | should you need to change settings, 147 | a list of settings is available using the `%config` line magic. 148 | 149 | ``` 150 | In [8]: %config PrqlMagic 151 | PrqlMagic(SqlMagic) options 152 | ------------------------- 153 | PrqlMagic.autocommit= 154 | Set autocommit mode 155 | Current: True 156 | PrqlMagic.autolimit= 157 | Automatically limit the size of the returned result sets 158 | Current: 0 159 | PrqlMagic.autopandas= 160 | Return Pandas DataFrames instead of regular result sets 161 | Current: True 162 | PrqlMagic.autopolars= 163 | Return Polars DataFrames instead of regular result sets 164 | Current: False 165 | PrqlMagic.autoview= 166 | Display results 167 | Current: True 168 | PrqlMagic.column_local_vars= 169 | Return data into local variables from column names 170 | Current: False 171 | PrqlMagic.displaycon= 172 | Show connection string after execute 173 | Current: False 174 | PrqlMagic.displaylimit= 175 | Automatically limit the number of rows displayed (full result set is still 176 | stored) 177 | Current: None 178 | PrqlMagic.dryrun= 179 | Only print the compiled SQL 180 | Current: False 181 | PrqlMagic.dsn_filename= 182 | Path to DSN file. When the first argument is of the form [section], a 183 | sqlalchemy connection string is formed from the matching section in the DSN 184 | file. 185 | Current: 'odbc.ini' 186 | PrqlMagic.feedback= 187 | Print number of rows affected by DML 188 | Current: False 189 | PrqlMagic.polars_dataframe_kwargs==... 190 | Polars DataFrame constructor keyword arguments(e.g. infer_schema_length, 191 | nan_to_null, schema_overrides, etc) 192 | Current: {} 193 | PrqlMagic.short_errors= 194 | Don't display the full traceback on SQL Programming Error 195 | Current: True 196 | PrqlMagic.style= 197 | Set the table printing style to any of prettytable's defined styles 198 | (currently DEFAULT, MSWORD_FRIENDLY, PLAIN_COLUMNS, RANDOM) 199 | Current: 'DEFAULT' 200 | PrqlMagic.target= 201 | Compile target of prql-compiler 202 | Current: 'sql.any' 203 | ``` 204 | 205 | If you want to change any of these, 206 | you can do that with the `%config` line magic as well. 207 | 208 | ``` 209 | In [9]: %config PrqlMagic.autoview = False 210 | ``` 211 | 212 | [jupysql]: https://github.com/ploomber/jupysql 213 | [jupysqlfeat]: https://github.com/ploomber/jupysql#features 214 | [conn_str]: https://docs.sqlalchemy.org/en/14/core/engines.html#database-urls 215 | [duckdb]: https://duckdb.org 216 | [pandas]: https://pandas.pydata.org 217 | -------------------------------------------------------------------------------- /pyprql/magic/__init__.py: -------------------------------------------------------------------------------- 1 | """IPython/Jupyter magic for pyprql. 2 | 3 | Examples 4 | -------- 5 | A single function is defined herein. It should not be used directly by the user. Rather, 6 | any users should load the magic using the IPython line magic, like below: 7 | 8 | In [1]: %load_ext pyprql.magic 9 | 10 | """ 11 | 12 | from IPython import InteractiveShell 13 | 14 | from .prql import PrqlMagic 15 | 16 | 17 | def load_ipython_extension(ipython: InteractiveShell) -> None: 18 | """Load the ``pyprql.magic`` extension. 19 | 20 | This function is called automatically by ``IPython`` when the magic is loaded using 21 | ``%load_ext``. 22 | 23 | Parameters 24 | ---------- 25 | ipython: InteractiveShell 26 | The current IPython instance. 27 | """ 28 | ipython.register_magics(PrqlMagic) 29 | -------------------------------------------------------------------------------- /pyprql/magic/prql.py: -------------------------------------------------------------------------------- 1 | """A magic class for parsing PRQL in IPython or Jupyter.""" 2 | 3 | from __future__ import annotations 4 | 5 | import re 6 | 7 | from IPython.core.magic import cell_magic, line_magic, magics_class, needs_local_scope 8 | from IPython.core.magic_arguments import argument, magic_arguments, parse_argstring 9 | from prqlc import CompileOptions, compile 10 | from sql.magic import SqlMagic 11 | from sql.parse import parse 12 | from traitlets import Bool, Unicode 13 | 14 | 15 | @magics_class 16 | class PrqlMagic(SqlMagic): 17 | """Perform PRQL magics. 18 | 19 | This is a thin wrapper around ``sql.SqlMagic``, the class that provides the 20 | ``%%sql`` magic. For full documentation on usage and features, please see their 21 | `docs `_. 22 | 23 | We override their defaults in two cases: 24 | 25 | 1. autopandas is set to ``True``. 26 | 1. displaycon is set to ``False``. 27 | 28 | Additionally, to work around some quirky behaviour, we also provide an ``autoview`` 29 | option to indicate whether results should be printed to the window. 30 | 31 | Parameters 32 | ---------- 33 | shell : InteractiveShell 34 | The current IPython shell instance. Since instantiation is handled by IPython, 35 | the user should never need to create this clas manually. 36 | """ 37 | 38 | displaycon = Bool(False, config=True, help="Show connection string after execute") 39 | autopandas = Bool( 40 | True, 41 | config=True, 42 | help="Return Pandas DataFrames instead of regular result sets", 43 | ) 44 | autopolars = Bool( 45 | False, 46 | config=True, 47 | help="Return Polars DataFrames instead of regular result sets", 48 | ) 49 | autoview = Bool(True, config=True, help="Display results") 50 | feedback = Bool(False, config=True, help="Print number of rows affected by DML") 51 | target = Unicode("sql.any", config=True, help="Compile target of prql-compiler") 52 | dryrun = Bool(False, config=True, help="Only print the compiled SQL") 53 | 54 | @needs_local_scope 55 | @line_magic("prql") 56 | @cell_magic("prql") 57 | @magic_arguments() 58 | @argument("line", default="", nargs="*", type=str, help="prql") 59 | @argument( 60 | "-l", "--connections", action="store_true", help="list active connections" 61 | ) 62 | @argument("-x", "--close", type=str, help="close a session by name") 63 | @argument( 64 | "-c", "--creator", type=str, help="specify creator function for new connection" 65 | ) 66 | @argument( 67 | "-s", 68 | "--section", 69 | type=str, 70 | help="section of dsn_file to be used for generating a connection string", 71 | ) 72 | @argument( 73 | "-p", 74 | "--persist", 75 | action="store_true", 76 | help="create a table name in the database from the named DataFrame", 77 | ) 78 | @argument( 79 | "-n", 80 | "--no-index", 81 | action="store_true", 82 | help="Do not store Data Frame index when persisting", 83 | ) 84 | @argument( 85 | "--append", 86 | action="store_true", 87 | help="create, or append to, a table name in the database from the named DataFrame", 88 | ) 89 | @argument( 90 | "-a", 91 | "--connection_arguments", 92 | type=str, 93 | help="specify dictionary of connection arguments to pass to SQL driver", 94 | ) 95 | @argument("-f", "--file", type=str, help="Run PRQL from file at this path") 96 | def prql( 97 | self, line: str = "", cell: str = "", local_ns: dict | None = None 98 | ) -> None: 99 | """Create the PRQL magic. 100 | 101 | Returns 102 | ------- 103 | None 104 | """ 105 | local_ns = local_ns or {} 106 | self.args = parse_argstring(self.execute, line) 107 | line_prql = parse(" ".join(self.args.line), self.execute)["sql"] 108 | if line_prql and not self.args.persist and not self.args.append: 109 | cell = line_prql + "\n" + cell 110 | _escaped_prql = re.escape(line_prql) 111 | _pattern = re.sub(r"\\\s", r"\\s+", _escaped_prql) 112 | line = re.sub(_pattern, "", line) 113 | if self.args.file: 114 | with open(self.args.file) as infile: 115 | cell = infile.read() 116 | line = re.sub(r"(\-f|\-\-file)\s+" + self.args.file, "", line) 117 | # If cell is occupied, parsed to SQL 118 | if cell: 119 | cell = compile( 120 | cell, 121 | CompileOptions(target=self.target, format=True, signature_comment=True), 122 | ) 123 | if self.dryrun: 124 | print(cell) 125 | return None 126 | result = super().execute(line=line, cell=cell, local_ns=local_ns) 127 | return result 128 | -------------------------------------------------------------------------------- /pyprql/pandas_accessor/__init__.py: -------------------------------------------------------------------------------- 1 | """Init file for pyprql.pandas. 2 | 3 | Examples 4 | -------- 5 | import pandas as pd 6 | import pyprql.pandas 7 | df = pd.DataFrame({}) 8 | results_df = df.prql.query('select [age,name,occupation] | filter age > 21') 9 | 10 | """ 11 | 12 | import pyprql.pandas_accessor.prql # noqa: F401 13 | -------------------------------------------------------------------------------- /pyprql/pandas_accessor/prql.py: -------------------------------------------------------------------------------- 1 | """Pandas Dataframe accessor for PRQL. 2 | 3 | Examples 4 | -------- 5 | import pandas as pd 6 | import pyprql.pandas 7 | df = pd.DataFrame({}) 8 | results_df = df.prql.query('select [age,name,occupation] | filter age > 21') 9 | 10 | """ 11 | 12 | import duckdb 13 | import pandas as pd 14 | import prqlc 15 | 16 | 17 | @pd.api.extensions.register_dataframe_accessor("prql") 18 | class PrqlAccessor: 19 | def __init__(self, pandas_obj: object) -> None: 20 | self._obj = pandas_obj 21 | 22 | def query(self, prql_query: str) -> pd.DataFrame: 23 | prepended_query = f"from df \n {prql_query}" 24 | sql_query = prqlc.compile( 25 | prepended_query, 26 | options=prqlc.CompileOptions( 27 | target="sql.duckdb", format=False, signature_comment=False 28 | ), 29 | ) 30 | return duckdb.query_df( 31 | self._obj, 32 | virtual_table_name="df", 33 | sql_query=sql_query, 34 | ).df() 35 | -------------------------------------------------------------------------------- /pyprql/polars_namespace/__init__.py: -------------------------------------------------------------------------------- 1 | from .prql import PrqlNamespace # noqa: F401 2 | -------------------------------------------------------------------------------- /pyprql/polars_namespace/prql.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import Generic, TypeVar 4 | 5 | import polars as pl 6 | import prqlc 7 | 8 | T_DF = TypeVar("T_DF", pl.DataFrame, pl.LazyFrame) 9 | 10 | 11 | @pl.api.register_dataframe_namespace("prql") 12 | @pl.api.register_lazyframe_namespace("prql") 13 | class PrqlNamespace(Generic[T_DF]): 14 | def __init__(self, df: T_DF): 15 | self._df: T_DF = df 16 | 17 | def query(self, prql_query: str, *, table_name: str | None = None) -> T_DF: 18 | prepended_query: str = f"from self \n {prql_query}" 19 | sql_query: str = prqlc.compile( 20 | prepended_query, 21 | options=prqlc.CompileOptions( 22 | target="sql.any", format=False, signature_comment=False 23 | ), 24 | ) 25 | return self._df.sql(sql_query, table_name=table_name) 26 | -------------------------------------------------------------------------------- /pyprql/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PRQL/pyprql/b411f2e65b33163aa2790c21444e0739304bb295/pyprql/py.typed -------------------------------------------------------------------------------- /pyprql/tests/__init__.py: -------------------------------------------------------------------------------- 1 | from typing import TYPE_CHECKING 2 | 3 | if TYPE_CHECKING: 4 | import IPython 5 | 6 | 7 | def run_sql(ip_session: "IPython.core.interactiveshell.InteractiveShell", statements): 8 | if isinstance(statements, str): 9 | statements = [statements] 10 | for statement in statements: 11 | result = ip_session.run_line_magic("sql", f"sqlite:// {statement}") 12 | return result # returns only last result 13 | 14 | 15 | def run_prql(ip_session: "IPython.core.interactiveshell.InteractiveShell", statements): 16 | if isinstance(statements, str): 17 | statements = [statements] 18 | for statement in statements: 19 | result = ip_session.run_line_magic("prql", f"sqlite:// {statement}") 20 | return result # returns only last result 21 | -------------------------------------------------------------------------------- /pyprql/tests/_regtest_outputs/test_magic.test_memory_db.out: -------------------------------------------------------------------------------- 1 | n name 2 | 0 1 foo 3 | 1 2 bar 4 | -------------------------------------------------------------------------------- /pyprql/tests/_regtest_outputs/test_magic.test_pass_existing_engine.out: -------------------------------------------------------------------------------- 1 | n name 2 | 0 10 foo 3 | 1 20 bar 4 | -------------------------------------------------------------------------------- /pyprql/tests/conftest.py: -------------------------------------------------------------------------------- 1 | import os 2 | import urllib.request 3 | from pathlib import Path 4 | 5 | import pytest 6 | from sql import _current, connection 7 | from sql._testing import TestingShell 8 | from sql.connection import ConnectionManager 9 | from sql.magic import RenderMagic, SqlMagic 10 | from sql.magic_cmd import SqlCmdMagic 11 | from sql.magic_plot import SqlPlotMagic 12 | from traitlets.config import Config 13 | 14 | from pyprql.magic import PrqlMagic 15 | 16 | PATH_TO_TESTS = Path(__file__).absolute().parent 17 | PATH_TO_TMP_ASSETS = PATH_TO_TESTS / "tmp" 18 | PATH_TO_TMP_ASSETS.mkdir(exist_ok=True) 19 | 20 | 21 | def path_to_tests(): 22 | return PATH_TO_TESTS 23 | 24 | 25 | @pytest.fixture(scope="function", autouse=True) 26 | def isolate_connections(monkeypatch): 27 | """ 28 | Fixture to ensure connections are isolated between tests, preventing tests 29 | from accidentally closing connections created by other tests. 30 | """ 31 | connections = {} 32 | monkeypatch.setattr(connection.ConnectionManager, "connections", connections) 33 | monkeypatch.setattr(connection.ConnectionManager, "current", None) 34 | yield 35 | connection.ConnectionManager.close_all() 36 | 37 | 38 | @pytest.fixture 39 | def chinook_db(): 40 | path = PATH_TO_TMP_ASSETS / "my.db" 41 | if not path.is_file(): 42 | url = ( 43 | "https://raw.githubusercontent.com" 44 | "/lerocha/chinook-database/master/" 45 | "ChinookDatabase/DataSources/Chinook_Sqlite.sqlite" 46 | ) 47 | urllib.request.urlretrieve(url, path) 48 | 49 | return str(path) 50 | 51 | 52 | @pytest.fixture 53 | def ip_empty(): 54 | c = Config() 55 | # By default, InteractiveShell will record command's history in a SQLite database 56 | # which leads to "too many open files" error when running tests; this setting 57 | # disables the history recording. 58 | # https://ipython.readthedocs.io/en/stable/config/options/terminal.html#configtrait-HistoryAccessor.enabled 59 | c.HistoryAccessor.enabled = False 60 | ip_session = TestingShell(config=c) 61 | 62 | sql_magic = SqlMagic(ip_session) 63 | _current._set_sql_magic(sql_magic) 64 | 65 | ip_session.register_magics(sql_magic) 66 | ip_session.register_magics(RenderMagic) 67 | ip_session.register_magics(SqlPlotMagic) 68 | ip_session.register_magics(SqlCmdMagic) 69 | ip_session.register_magics(PrqlMagic) 70 | ip_session.register_magics(RenderMagic) 71 | 72 | # there is some weird bug in ipython that causes this function to hang the pytest 73 | # process when all tests have been executed (an internal call to gc.collect() 74 | # hangs). This is a workaround. 75 | ip_session.displayhook.flush = lambda: None 76 | 77 | yield ip_session 78 | ConnectionManager.close_all() 79 | 80 | 81 | def insert_sample_data(ip): 82 | ip.run_cell( 83 | """%%sql 84 | CREATE TABLE test (n INT, name TEXT); 85 | INSERT INTO test VALUES (1, 'foo'); 86 | INSERT INTO test VALUES (2, 'bar'); 87 | CREATE TABLE [table with spaces] (first INT, second TEXT); 88 | CREATE TABLE author (first_name, last_name, year_of_death); 89 | INSERT INTO author VALUES ('William', 'Shakespeare', 1616); 90 | INSERT INTO author VALUES ('Bertold', 'Brecht', 1956); 91 | CREATE TABLE empty_table (column INT, another INT); 92 | CREATE TABLE website (person, link, birthyear INT); 93 | INSERT INTO website VALUES ('Bertold Brecht', 94 | 'https://en.wikipedia.org/wiki/Bertolt_Brecht', 1954 ); 95 | INSERT INTO website VALUES ('William Shakespeare', 96 | 'https://en.wikipedia.org/wiki/William_Shakespeare', 1564); 97 | INSERT INTO website VALUES ('Steve Steve', 'google_link', 2023); 98 | CREATE TABLE number_table (x INT, y INT); 99 | INSERT INTO number_table VALUES (4, (-2)); 100 | INSERT INTO number_table VALUES ((-5), 0); 101 | INSERT INTO number_table VALUES (2, 4); 102 | INSERT INTO number_table VALUES (0, 2); 103 | INSERT INTO number_table VALUES ((-5), (-1)); 104 | INSERT INTO number_table VALUES ((-2), (-3)); 105 | INSERT INTO number_table VALUES ((-2), (-3)); 106 | INSERT INTO number_table VALUES ((-4), 2); 107 | INSERT INTO number_table VALUES (2, (-5)); 108 | INSERT INTO number_table VALUES (4, 3); 109 | """ 110 | ) 111 | 112 | 113 | @pytest.fixture 114 | def ip(ip_empty): 115 | """Provides an IPython session in which tables have been created""" 116 | ip_empty.run_cell("%sql sqlite://") 117 | insert_sample_data(ip_empty) 118 | 119 | yield ip_empty 120 | 121 | ConnectionManager.close_all() 122 | 123 | 124 | @pytest.fixture 125 | def ip_dbapi(ip_empty): 126 | ip_empty.run_cell("import sqlite3; conn = sqlite3.connect(':memory:');") 127 | ip_empty.run_cell("%sql conn") 128 | insert_sample_data(ip_empty) 129 | 130 | yield ip_empty 131 | 132 | ConnectionManager.close_all() 133 | 134 | 135 | # @pytest.fixture 136 | # def ip(): 137 | # """Provides an IPython session in which tables have been created""" 138 | # ip_session = InteractiveShell() 139 | # ip_session.register_magics(SqlMagic) 140 | 141 | # # run_prql creates an inmemory sqlitedatabase 142 | # run_sql( 143 | # ip_session, 144 | # [ 145 | # "CREATE TABLE test (n INT, name TEXT)", 146 | # "INSERT INTO test VALUES (1, 'foo')", 147 | # "INSERT INTO test VALUES (2, 'bar')", 148 | # "CREATE TABLE author (first_name, last_name, year_of_death)", 149 | # "INSERT INTO author VALUES ('William', 'Shakespeare', 1616)", 150 | # "INSERT INTO author VALUES ('Bertold', 'Brecht', 1956)", 151 | # ], 152 | # ) 153 | # yield ip_session 154 | # run_sql(ip_session, "DROP TABLE test") 155 | # run_sql(ip_session, "DROP TABLE author") 156 | 157 | 158 | @pytest.fixture 159 | def tmp_empty(tmp_path): 160 | """ 161 | Create temporary path using pytest native fixture, 162 | them move it, yield, and restore the original path 163 | """ 164 | 165 | old = os.getcwd() 166 | os.chdir(str(tmp_path)) 167 | yield str(Path(tmp_path).resolve()) 168 | os.chdir(old) 169 | -------------------------------------------------------------------------------- /pyprql/tests/test_magic.py: -------------------------------------------------------------------------------- 1 | """ 2 | These tests are heavily borrowed from 3 | https://github.com/ploomber/jupysql/blob/0.5.1/src/tests/test_magic.py 4 | 5 | Many are xfailed because we don't yet support them. Others are lightly adapted for PRQL, 6 | and there are some TODOs around a fuller transition. 7 | 8 | Thanks to @ploomber for providing the base for these tests as well as the extension. 9 | """ 10 | 11 | import os.path 12 | import re 13 | import tempfile 14 | from textwrap import dedent 15 | 16 | import polars as pl 17 | import pytest 18 | from sqlalchemy import create_engine 19 | 20 | from pyprql.tests import run_sql 21 | 22 | from . import run_prql 23 | 24 | 25 | def test_memory_db(ip, regtest): 26 | print(run_prql(ip, "from test"), file=regtest) 27 | 28 | 29 | def test_html(ip): 30 | result = run_prql(ip, "from test") 31 | assert "foo" in result._repr_html_().lower() 32 | 33 | 34 | def test_line_magic(ip): 35 | result = ip.run_line_magic("prql", "from test | select {name}") 36 | assert "foo" in str(result) 37 | 38 | 39 | @pytest.mark.skip(reason="We only support pandas") 40 | def test_print(ip): 41 | result = run_prql(ip, "from test") 42 | assert re.search(r"1\s+\|\s+foo", str(result)) 43 | 44 | 45 | @pytest.mark.skip(reason="We only support pandas") 46 | def test_plain_style(ip): 47 | ip.run_line_magic("config", "SqlMagic.style = 'PLAIN_COLUMNS'") 48 | result = run_prql(ip, "from test") 49 | assert re.search(r"1\s+\|\s+foo", str(result)) 50 | 51 | 52 | @pytest.mark.skip 53 | def test_multi_sql(ip): 54 | result = ip.run_cell_magic( 55 | "prql", 56 | "", 57 | """ 58 | sqlite:// 59 | from author 60 | """, 61 | ) 62 | assert "Shakespeare" in str(result) and "Brecht" in str(result) 63 | 64 | 65 | def test_result_var(ip, capsys): 66 | ip.run_line_magic("config", "SqlMagic.autopandas = False") 67 | ip.run_cell_magic( 68 | "prql", 69 | "sqlite:// x <<", 70 | """ 71 | from author 72 | select last_name 73 | """, 74 | ) 75 | result = ip.user_global_ns["x"] 76 | out, _ = capsys.readouterr() 77 | 78 | assert "Shakespeare" in str(result) and "Brecht" in str(result) 79 | assert "Returning data to local variable" not in out 80 | 81 | 82 | @pytest.mark.xfail(reason="Not supported in PRQL") 83 | def test_result_var_multiline_shovel(ip): 84 | ip.run_cell_magic( 85 | "prql", 86 | "", 87 | """ 88 | x << from author 89 | select last_name 90 | """, 91 | ) 92 | result = ip.user_global_ns["x"] 93 | assert "Shakespeare" in str(result) and "Brecht" in str(result) 94 | 95 | 96 | @pytest.mark.skip(reason="We only support pandas") 97 | def test_access_results_by_keys(ip): 98 | assert run_prql(ip, "from author")["author"] == ( 99 | "William", 100 | "Shakespeare", 101 | 1616, 102 | ) 103 | 104 | 105 | def test_duplicate_column_names_accepted(ip): 106 | ip.run_line_magic("config", "SqlMagic.autopandas = False") 107 | result = ip.run_cell_magic( 108 | "prql", 109 | "sqlite://", 110 | """ 111 | from author | select {last_name, last_name} 112 | """, 113 | ) 114 | assert ("Brecht", "Brecht") in result 115 | 116 | 117 | def test_persist(ip): 118 | ip.run_line_magic("config", "SqlMagic.autopandas = False") 119 | run_prql(ip, "") 120 | ip.run_cell("results = %prql from test") 121 | ip.run_cell("results_dframe = results.DataFrame()") 122 | ip.run_cell("%sql --persist sqlite:// results_dframe") 123 | persisted = run_prql(ip, "from results_dframe") 124 | assert persisted == [(0, 1, "foo"), (1, 2, "bar")] 125 | 126 | 127 | def test_persist_no_index(ip): 128 | ip.run_line_magic("config", "SqlMagic.autopandas = False") 129 | run_prql(ip, "") 130 | ip.run_cell("results = %prql from test") 131 | ip.run_cell("results_no_index = results.DataFrame()") 132 | ip.run_cell("%prql --persist sqlite:// results_no_index --no-index") 133 | persisted = run_prql(ip, "from results_no_index") 134 | assert persisted == [(1, "foo"), (2, "bar")] 135 | 136 | 137 | def test_append(ip): 138 | ip.run_line_magic("config", "SqlMagic.autopandas = False") 139 | run_prql(ip, "") 140 | ip.run_cell("results = %prql from test") 141 | ip.run_cell("results_dframe_append = results.DataFrame()") 142 | ip.run_cell("%prql --persist sqlite:// results_dframe_append") 143 | persisted = run_prql(ip, "from results_dframe_append") 144 | ip.run_cell("%prql --append sqlite:// results_dframe_append") 145 | appended = run_prql(ip, "from results_dframe_append") 146 | assert appended[0][0] == persisted[0][0] * 2 147 | 148 | 149 | @pytest.mark.xfail(reason="Need to resolve line vs cell magic") 150 | def test_persist_frame_at_its_creation(ip): 151 | ip.run_cell("results = %sql from author") 152 | ip.run_cell("%sql --persist sqlite:// results.DataFrame()") 153 | persisted = run_prql(ip, "from results") 154 | assert "Shakespeare" in str(persisted) 155 | 156 | 157 | def test_connection_args_in_connection(ip): 158 | ip.run_cell('%sql --connection_arguments {"timeout":10} sqlite:///:memory:') 159 | result = ip.run_cell("%sql --connections") 160 | assert "timeout" in result.result["sqlite:///:memory:"].connect_args 161 | 162 | 163 | def test_connection_args_single_quotes(ip): 164 | ip.run_cell("%sql --connection_arguments '{\"timeout\": 10}' sqlite:///:memory:") 165 | result = ip.run_cell("%sql --connections") 166 | assert "timeout" in result.result["sqlite:///:memory:"].connect_args 167 | 168 | 169 | # TODO: support 170 | # @with_setup(_setup_author, _teardown_author) 171 | # def test_persist_with_connection_info(): 172 | # ip.run_cell("results = %sql from author") 173 | # ip.run_line_magic('sql', 'sqlite:// PERSIST results.DataFrame()') 174 | # persisted = ip.run_line_magic('sql', 'SELECT * FROM results') 175 | # assert 'Shakespeare' in str(persisted) 176 | 177 | 178 | @pytest.mark.xfail(reason="Need to implement sample data in PRQL") 179 | def test_displaylimit(ip, regtest): 180 | ip.run_line_magic("config", "SqlMagic.autolimit = None") 181 | ip.run_line_magic("config", "SqlMagic.displaylimit = None") 182 | result = run_prql( 183 | ip, 184 | "SELECT * FROM (VALUES ('apple'), ('banana'), ('cherry')) " 185 | "AS Result ORDER BY 1;", 186 | ) 187 | regtest.write(result._repr_html_(), file=regtest) 188 | 189 | assert "apple" in result._repr_html_() 190 | assert "banana" in result._repr_html_() 191 | assert "cherry" in result._repr_html_() 192 | 193 | ip.run_line_magic("config", "SqlMagic.displaylimit = 1") 194 | result = run_prql( 195 | ip, 196 | "SELECT * FROM (VALUES ('apple'), ('banana'), ('cherry')) " 197 | "AS Result ORDER BY 1;", 198 | ) 199 | assert "apple" in result._repr_html_() 200 | assert "cherry" not in result._repr_html_() 201 | 202 | 203 | @pytest.mark.xfail(reason="Not supported in PRQL") 204 | def test_column_local_vars(ip): 205 | ip.run_line_magic("config", "SqlMagic.column_local_vars = True") 206 | result = run_prql(ip, "from author") 207 | assert result is None 208 | assert "William" in ip.user_global_ns["first_name"] 209 | assert "Shakespeare" in ip.user_global_ns["last_name"] 210 | assert len(ip.user_global_ns["first_name"]) == 2 211 | ip.run_line_magic("config", "SqlMagic.column_local_vars = False") 212 | 213 | 214 | @pytest.mark.skip(reason="Not supported in PRQL") 215 | def test_userns_not_changed(ip): 216 | ip.run_cell( 217 | dedent( 218 | """ 219 | def function(): 220 | local_var = 'local_val' 221 | %sql sqlite:// INSERT INTO test VALUES (2, 'bar'); 222 | function()""" 223 | ) 224 | ) 225 | assert "local_var" not in ip.user_ns 226 | 227 | 228 | @pytest.mark.xfail(reason="Not supported in PRQL") 229 | def test_bind_vars(ip): 230 | ip.user_global_ns["x"] = 22 231 | result = run_prql(ip, "SELECT :x") 232 | assert result[0][0] == 22 233 | 234 | 235 | def test_autopandas(ip): 236 | dframe = run_prql(ip, "from test") 237 | assert not dframe.empty 238 | assert dframe.ndim == 2 239 | assert dframe.name[0] == "foo" 240 | 241 | 242 | def test_autopolars(ip): 243 | ip.run_line_magic("config", "PrqlMagic.autopolars = True") 244 | dframe = run_prql(ip, "from test") 245 | 246 | assert type(dframe) is pl.DataFrame 247 | assert not dframe.is_empty() 248 | assert len(dframe.shape) == 2 249 | assert dframe["name"][0] == "foo" 250 | 251 | 252 | def test_target_dialect(ip): 253 | ip.run_line_magic("config", 'PrqlMagic.target = "sql.sqlite"') 254 | dframe = run_prql( 255 | ip, 'from author | select foo = f"{first_name}-{last_name}" | take 1' 256 | ) 257 | assert dframe.foo[0] == "William-Shakespeare" 258 | 259 | 260 | def test_dryrun(ip, capsys): 261 | ip.run_line_magic("config", "PrqlMagic.dryrun = True") 262 | result = run_prql(ip, 'from a | select b = f"{c}-{d}"') 263 | captured = capsys.readouterr() 264 | assert captured.out.startswith("SELECT\n CONCAT") 265 | assert result is None 266 | 267 | 268 | def test_csv(ip): 269 | ip.run_line_magic("config", "SqlMagic.autopandas = False") # uh-oh 270 | result = run_prql(ip, "from test") 271 | result = result.csv() 272 | for row in result.splitlines(): 273 | assert row.count(",") == 1 274 | assert len(result.splitlines()) == 3 275 | 276 | 277 | def test_csv_to_file(ip): 278 | ip.run_line_magic("config", "SqlMagic.autopandas = False") # uh-oh 279 | result = run_prql(ip, "from test") 280 | with tempfile.TemporaryDirectory() as tempdir: 281 | fname = os.path.join(tempdir, "test.csv") 282 | output = result.csv(fname) 283 | assert os.path.exists(output.file_path) 284 | with open(output.file_path) as csvfile: 285 | content = csvfile.read() 286 | for row in content.splitlines(): 287 | assert row.count(",") == 1 288 | assert len(content.splitlines()) == 3 289 | 290 | 291 | def test_sql_from_file(ip): 292 | ip.run_line_magic("config", "PrqlMagic.autopandas = False") 293 | with tempfile.TemporaryDirectory() as tempdir: 294 | fname = os.path.join(tempdir, "test.sql") 295 | with open(fname, "w") as tempf: 296 | tempf.write("from test") 297 | result = ip.run_cell("%prql --file " + fname) 298 | assert result.result == [(1, "foo"), (2, "bar")] 299 | result = ip.run_cell("%prql -f " + fname) 300 | assert result.result == [(1, "foo"), (2, "bar")] 301 | 302 | 303 | @pytest.mark.skip("We only support pandas") 304 | def test_dict(ip): 305 | result = run_prql(ip, "from author") 306 | result = result.dict() 307 | assert isinstance(result, dict) 308 | assert "first_name" in result 309 | assert "last_name" in result 310 | assert "year_of_death" in result 311 | assert len(result["last_name"]) == 2 312 | 313 | 314 | @pytest.mark.skip("We only support pandas") 315 | def test_dicts(ip): 316 | result = run_prql(ip, "from author") 317 | for row in result.dicts(): 318 | assert isinstance(row, dict) 319 | assert "first_name" in row 320 | assert "last_name" in row 321 | assert "year_of_death" in row 322 | 323 | 324 | @pytest.mark.xfail(reason="Not supported in PRQL") 325 | def test_bracket_var_substitution(ip): 326 | ip.user_global_ns["col"] = "first_name" 327 | assert run_prql(ip, "from author | filter WHERE {col} = 'William' ")[0] == ( 328 | "William", 329 | "Shakespeare", 330 | 1616, 331 | ) 332 | 333 | ip.user_global_ns["col"] = "last_name" 334 | result = run_prql(ip, "from author | filter WHERE {col} = 'William' ") 335 | assert not result 336 | 337 | 338 | # the next two tests had the same name, so I added a _2 to the second one 339 | @pytest.mark.xfail(reason="Not supported in PRQL") 340 | def test_multiline_bracket_var_substitution(ip): 341 | ip.user_global_ns["col"] = "first_name" 342 | assert run_prql(ip, "SELECT * FROM author\n WHERE {col} = 'William' ")[0] == ( 343 | "William", 344 | "Shakespeare", 345 | 1616, 346 | ) 347 | 348 | ip.user_global_ns["col"] = "last_name" 349 | result = run_prql(ip, "SELECT * FROM author WHERE {col} = 'William' ") 350 | assert not result 351 | 352 | 353 | @pytest.mark.xfail(reason="Not supported in PRQL") 354 | def test_multiline_bracket_var_substitution_2(ip): 355 | ip.user_global_ns["col"] = "first_name" 356 | result = ip.run_cell_magic( 357 | "prql", 358 | "", 359 | """ 360 | sqlite:// SELECT * FROM author 361 | WHERE {col} = 'William' 362 | """, 363 | ) 364 | assert ("William", "Shakespeare", 1616) in result 365 | 366 | ip.user_global_ns["col"] = "last_name" 367 | result = ip.run_cell_magic( 368 | "prql", 369 | "", 370 | """ 371 | sqlite:// SELECT * FROM author 372 | WHERE {col} = 'William' 373 | """, 374 | ) 375 | assert not result 376 | 377 | 378 | def test_json_in_select(ip): 379 | # Variable expansion does not work within json, but 380 | # at least the two usages of curly braces do not collide 381 | ip.user_global_ns["person"] = "prince" 382 | result = ip.run_cell_magic( 383 | "sql", 384 | "", 385 | """ 386 | sqlite:// 387 | SELECT 388 | '{"greeting": "Farewell sweet {person}"}' 389 | AS json 390 | """, 391 | ) 392 | 393 | assert result == [('{"greeting": "Farewell sweet {person}"}',)] 394 | 395 | 396 | def test_close_connection(ip): 397 | # TODO: change this to testing run_prql 398 | connections = run_sql(ip, "%sql -l") 399 | connection_name = list(connections)[0] 400 | run_sql(ip, f"%sql -x {connection_name}") 401 | connections_afterward = run_sql(ip, "%sql -l") 402 | assert connection_name not in connections_afterward 403 | 404 | 405 | def test_pass_existing_engine(ip, tmp_empty, regtest): 406 | ip.user_global_ns["my_engine"] = create_engine("sqlite:///my.db") 407 | ip.run_line_magic("sql", " my_engine ") 408 | 409 | run_sql( 410 | ip, 411 | [ 412 | "CREATE TABLE some_data (n INT, name TEXT)", 413 | "INSERT INTO some_data VALUES (10, 'foo')", 414 | "INSERT INTO some_data VALUES (20, 'bar')", 415 | ], 416 | ) 417 | 418 | result = ip.run_line_magic("prql", "from some_data") 419 | 420 | print(result, file=regtest) 421 | 422 | 423 | # theres some weird shared state with this one, moving it to the end 424 | def test_autolimit(ip): 425 | ip.run_line_magic("config", "SqlMagic.autolimit = 0") 426 | result = run_prql(ip, "from test") 427 | assert len(result) == 2 428 | ip.run_line_magic("config", "SqlMagic.autolimit = 1") 429 | result = run_prql(ip, "from test") 430 | assert len(result) == 1 431 | assert len(result) == 1 432 | assert len(result) == 1 433 | -------------------------------------------------------------------------------- /pyprql/tests/test_polars_namespace.py: -------------------------------------------------------------------------------- 1 | import polars as pl 2 | import pytest 3 | 4 | 5 | @pytest.fixture(autouse=True) 6 | def import_accessor(): 7 | import pyprql.polars_namespace # noqa 8 | 9 | 10 | def test_polars_df_namespace(): 11 | df = pl.DataFrame({"latitude": [1, 2, 3], "longitude": [1, 2, 3]}) 12 | res = df.prql.query( 13 | "select {latitude, longitude} | filter latitude > 1 | sort latitude" 14 | ) 15 | assert res.to_dict(as_series=False) == { 16 | "latitude": [2, 3], 17 | "longitude": [2, 3], 18 | } 19 | 20 | 21 | def test_polars_lf_namespace(): 22 | df = pl.LazyFrame({"latitude": [1, 2, 3], "longitude": [1, 2, 3]}) 23 | res = df.prql.query( 24 | "select {latitude, longitude} | filter latitude > 1 | sort latitude" 25 | ).collect() 26 | assert res.to_dict(as_series=False) == { 27 | "latitude": [2, 3], 28 | "longitude": [2, 3], 29 | } 30 | -------------------------------------------------------------------------------- /pyprql/tests/test_prql_python.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import prqlc 3 | import pytest 4 | 5 | 6 | @pytest.fixture(autouse=True) 7 | def import_accessor(): 8 | import pyprql.pandas_accessor # noqa 9 | 10 | 11 | def test_pyql_python(): 12 | """It compiles sql from prql.""" 13 | sql: str = prqlc.compile("from employees | select {name, age}").replace("\n", " ") 14 | assert sql.startswith("SELECT name, age FROM employees") 15 | 16 | 17 | def test_df_accessor(): 18 | df = pd.DataFrame({"latitude": [1, 2, 3], "longitude": [1, 2, 3]}) 19 | res = df.prql.query("select {latitude, longitude} | filter latitude > 1") 20 | assert len(res.index) == 2 21 | assert res.iloc[0]["latitude"] == 2 22 | assert res.iloc[1]["latitude"] == 3 23 | 24 | 25 | def test_target_dialect(): 26 | df = pd.DataFrame({"foo": ["a"], "bar": ["b"]}) 27 | res = df.prql.query("select !{bar}") # duckdb supports EXCLUDE 28 | assert len(res.columns) == 1 29 | 30 | 31 | def test_df_supports_grouped_aggs(): 32 | rows = { 33 | "title": ["ceo", "developer", "wizard"], 34 | "country": ["USA", "USA", "Slovenia"], 35 | "salary": [120, 100, 130], 36 | } 37 | df = pd.DataFrame(rows) 38 | res = df.prql.query( 39 | """ 40 | group {country} ( 41 | aggregate { 42 | avg_sal = average salary, 43 | ct = count this 44 | } 45 | ) 46 | """ 47 | ) 48 | 49 | row1 = res.iloc[0] 50 | row2 = res.iloc[1] 51 | 52 | assert row1["country"] == "USA" 53 | assert row2["country"] == "Slovenia" 54 | 55 | assert row1["avg_sal"] == 110 56 | assert row2["avg_sal"] == 130 57 | 58 | 59 | def test_df_big_prql_query(): 60 | q = """ 61 | filter start_date > @2021-01-01T00:00:00 62 | derive { 63 | gross_salary = salary + tax ?? 0, 64 | gross_cost = gross_salary + benefits_cost, 65 | } 66 | filter gross_cost > 0 67 | group {title, country} ( 68 | aggregate { 69 | avg_gross_salary = average gross_salary, 70 | sum_gross_cost = sum gross_cost, 71 | cnt = count this 72 | } 73 | ) 74 | filter sum_gross_cost > 100 75 | derive id = f"{title}_{country}" 76 | sort {sum_gross_cost, -country} 77 | take 1..20 78 | """ 79 | rows = { 80 | "title": ["developer", "developer", "wizard", "horologist"], 81 | "country": ["USA", "USA", "Slovenia", "Slovenia"], 82 | "benefits_cost": [10, 20, 50, 0], 83 | "salary": [120, 100, 130, 0], 84 | "tax": [1, 1, 2, 0], 85 | "start_date": [ 86 | pd.Timestamp("2022-01-01"), 87 | pd.Timestamp("2022-01-02"), 88 | pd.Timestamp("2022-01-03"), 89 | pd.Timestamp("2020-01-01"), 90 | ], 91 | } 92 | df = pd.DataFrame(rows) 93 | res = df.prql.query(q) 94 | row1 = res.iloc[0] 95 | row2 = res.iloc[1] 96 | 97 | assert len(res.index) == 2 98 | 99 | assert row1["country"] == "Slovenia" 100 | assert row1["cnt"] == 1 # the other slovenia was hired in 2020 101 | assert row1["avg_gross_salary"] == 132 102 | assert row1["sum_gross_cost"] == 182 103 | assert row1["id"] == "wizard_Slovenia" 104 | 105 | assert row2["country"] == "USA" 106 | assert row2["cnt"] == 2 107 | assert row2["avg_gross_salary"] == 111 108 | assert row2["sum_gross_cost"] == 252 109 | assert row2["id"] == "developer_USA" 110 | --------------------------------------------------------------------------------