Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced the outdated grako library to parse WKT with TatSu #1587

Merged
merged 4 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Replaced the outdated grako library to parse WKT with TatSu
  • Loading branch information
jze committed Sep 3, 2023
commit 2e71eb1ce3741fc7d261f6387a1460b70586fa42
4 changes: 2 additions & 2 deletions frictionless/fields/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ def value_reader(cell: Any):

# WKT
elif self.format == "wkt":
parser = platform.wkt.WktParser()
parser = platform.wkt.Parser()

def value_reader(cell: Any):
if not isinstance(cell, str):
return None
try:
parser.parse(cell, rule_name="wkt_representation")
parser.parse(cell)
except Exception:
return None
return cell
Expand Down
3 changes: 0 additions & 3 deletions frictionless/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ def inner(*args: Any, **kwargs: Any):
try:
return func(*args, **kwargs)
except Exception:
if name == "wkt" and sys.version_info >= (3, 10):
note = "WKT is not supported in Python3.10+ (grako is unmaintained)"
raise platform.frictionless.FrictionlessException(note)
module = import_module("frictionless.exception")
note = f'Please install "frictionless[{name}]"'
raise module.FrictionlessException(note)
Expand Down
2 changes: 1 addition & 1 deletion frictionless/vendors/wkt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .parser import WktParser
from .parser import Parser
Loading
Loading