From cf1f3a972b385110e01494b8a6f7e584c409bad4 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Sat, 10 Dec 2022 21:35:25 -0800 Subject: [PATCH 1/2] Deprecate TUI To quote what I wrote in the deprecation message: > Currently the PyPRQL CLI is unfortunately deprecated, since the original creators are no longer actively maintaning it. It was a valiant effort, and of the first things that was built on top of PRQL. But it's a big project that requires work to keep it current. > If anyone would be interested in taking it over, please feel free to start contributing. I hope that's reasonable --- .gitignore | 1 + README.md | 36 ++++++++++++------------------------ mypy.ini | 6 ------ pyproject.toml | 4 ++++ pyprql/cli/__init__.py | 15 +++++++++++++++ 5 files changed, 32 insertions(+), 30 deletions(-) delete mode 100644 mypy.ini diff --git a/.gitignore b/.gitignore index 51b261c..1251a3c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ coverage.xml .coverage .ipynb_checkpoints dist +.dmypy.json \ No newline at end of file diff --git a/README.md b/README.md index 7d03529..a7c2683 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,24 @@ ![GitHub contributors](https://img.shields.io/github/contributors/prql/pyprql) ![GitHub Repo stars](https://img.shields.io/github/stars/prql/pyprql) -[![CI/CD](https://github.com/prql/PyPrql/actions/workflows/cicd.yaml/badge.svg?branch=main)](https://github.com/prql/PyPrql/actions/workflows/cicd.yaml) +[![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) [![codecov](https://codecov.io/gh/prql/PyPrql/branch/main/graph/badge.svg?token=C6J2UI7FR5)](https://codecov.io/gh/prql/PyPrql) [![Codestyle: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/) -PyPRQL contains these tools: +PyPRQL contains - pyprql.pandas_accessor - Pandas integration for PRQL - pyprql.magic - IPython magic for connecting to databases using `%%prql` -- pyprql.cli - TUI for databases using PRQL -For docs, Check out the [PyPRQL Docs](https://pyprql.readthedocs.io/), and the [PRQL Book][prql_docs]. +For docs, Check out the [PyPRQL Docs](https://pyprql.readthedocs.io/), and the +[PRQL Book][prql_docs]. -This project is maintained by [@charlie-sanders](https://github.com/charlie-sanders/) and [@rbpatt2019](https://github.com/rbpatt2019) +This project was created by +[@charlie-sanders](https://github.com/charlie-sanders/) & +[@rbpatt2019](https://github.com/rbpatt2019) and is now maintained by the +broader PRQL team. ## Installation @@ -32,7 +35,9 @@ This project is maintained by [@charlie-sanders](https://github.com/charlie-sand pip install pyprql ``` -### Try out the Pandas integration +## Examples + +### Pandas integration ```python import pandas as pd @@ -40,10 +45,9 @@ import pyprql.pandas_accessor df = (...) results_df = df.prql.query('select [age,name,occupation] | filter age > 21') - ``` -### Try out the Jupyter Magic +### Jupyter Magic ```python In [1]: %load_ext pyprql.magic @@ -59,20 +63,4 @@ In [4]: %%prql results << ``` -### Try out the TUI - -With a CSV file: - -```bash -curl https://people.sc.fsu.edu/~jburkardt/data/csv/zillow.csv -pyprql zillow.csv -``` - -With a Database: - -```bash -pyprql 'postgresql://user:password@localhost:5432/database' -PRQL> show tables -``` - [prql_docs]: https://prql-lang.org/reference diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 246d05a..0000000 --- a/mypy.ini +++ /dev/null @@ -1,6 +0,0 @@ -# Global options: - -[mypy] -disable_error_code = union-attr, operator -exclude = /tests/ -# Per-module options:disable_error_code = union-atr diff --git a/pyproject.toml b/pyproject.toml index e7358cd..6fe414f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,11 @@ profile = "black" skip_gitignore = true [tool.mypy] +disable_error_code = ["union-attr", 'operator'] +exclude = "/tests/" files = "pyprql" +# TODO: ideally we would list the modules that aren't yet typed +ignore_missing_imports = true [build-system] build-backend = "poetry.core.masonry.api" diff --git a/pyprql/cli/__init__.py b/pyprql/cli/__init__.py index 5062abb..bfef5b0 100644 --- a/pyprql/cli/__init__.py +++ b/pyprql/cli/__init__.py @@ -1,10 +1,25 @@ """The command line interface implementation for PyPRQL.""" +import warnings + import sys from typing import List, Optional from pyprql.cli.cli import CLI +warnings.warn( + """ +Currently the is unfortunately deprecated, since the original creators are no +longer actively maintaning it. It was a valiant effort, and of the first things that +was built on top of PRQL. But it's a big project that requires work to keep it +current. + +If anyone would be interested in taking it over, please feel free to start contributing. +""", + DeprecationWarning, +) + + def main(params: Optional[List[str]] = None) -> None: """Serve the CLI entrypoint. From 8d840b84e30ff1610408ff6b1a55e2a612a935b3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 11 Dec 2022 05:36:11 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .gitignore | 2 +- pyprql/cli/__init__.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 1251a3c..3883e06 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,4 @@ coverage.xml .coverage .ipynb_checkpoints dist -.dmypy.json \ No newline at end of file +.dmypy.json diff --git a/pyprql/cli/__init__.py b/pyprql/cli/__init__.py index bfef5b0..0cbdd93 100644 --- a/pyprql/cli/__init__.py +++ b/pyprql/cli/__init__.py @@ -1,12 +1,10 @@ """The command line interface implementation for PyPRQL.""" -import warnings - import sys +import warnings from typing import List, Optional from pyprql.cli.cli import CLI - warnings.warn( """ Currently the is unfortunately deprecated, since the original creators are no