From a5fd86e070834dc6eef30a34ea22a8664a2b974a Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Sat, 11 May 2024 18:07:53 +0000 Subject: [PATCH] Prepare release 0.5.0 --- CHANGELOG.md | 11 +++++++++++ py_partiql_parser/__init__.py | 2 +- py_partiql_parser/_internal/json_parser.py | 12 +++--------- pyproject.toml | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d65abd9..38dbe0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ CHANGELOG ========= +0.5.5 +----- + - Add JsonParser to public API + - Improve performance for JsonParser when parsing a source with many documents + + +0.5.3 & 0.5.4 +----- + - Fix project build + + 0.5.2 ----- diff --git a/py_partiql_parser/__init__.py b/py_partiql_parser/__init__.py index 459d165..64d8997 100644 --- a/py_partiql_parser/__init__.py +++ b/py_partiql_parser/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.5.4" +__version__ = "0.5.5" from ._internal.parser import DynamoDBStatementParser, S3SelectParser # noqa diff --git a/py_partiql_parser/_internal/json_parser.py b/py_partiql_parser/_internal/json_parser.py index 7e97ab5..c5216be 100644 --- a/py_partiql_parser/_internal/json_parser.py +++ b/py_partiql_parser/_internal/json_parser.py @@ -15,19 +15,13 @@ class JsonParser: """ @staticmethod - def parse( # type: ignore[misc] - original: str, - tokenizer: Optional[ClauseTokenizer] = None, - only_parse_initial: bool = False, - ) -> Iterator[Any]: + def parse(original: str) -> Iterator[Any]: # type: ignore[misc] if not (original.startswith("{") or original.startswith("[")): # Doesn't look like JSON - let's return as a variable yield original if original.isnumeric() else Variable(original) - tokenizer = tokenizer or ClauseTokenizer(original) + tokenizer = ClauseTokenizer(original) while tokenizer.current() is not None: - result = JsonParser._get_next_document( - original, tokenizer, only_parse_initial - ) + result = JsonParser._get_next_document(original, tokenizer) if result is not None: yield result diff --git a/pyproject.toml b/pyproject.toml index b596b3d..957ef4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "py-partiql-parser" -version = "0.5.4" +version = "0.5.5" description = "Pure Python PartiQL Parser" readme = "README.md" keywords = ["pypartiql", "parser"]