Skip to content

Commit

Permalink
Prepare release 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bblommers committed May 11, 2024
1 parent 8e4c099 commit a5fd86e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
-----

Expand Down
2 changes: 1 addition & 1 deletion py_partiql_parser/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.5.4"
__version__ = "0.5.5"


from ._internal.parser import DynamoDBStatementParser, S3SelectParser # noqa
Expand Down
12 changes: 3 additions & 9 deletions py_partiql_parser/_internal/json_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down

0 comments on commit a5fd86e

Please sign in to comment.