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

Upgrade the frictionless package #1172

Open
yuanzhou opened this issue Feb 9, 2023 · 0 comments
Open

Upgrade the frictionless package #1172

yuanzhou opened this issue Feb 9, 2023 · 0 comments

Comments

@yuanzhou
Copy link
Member

yuanzhou commented Feb 9, 2023

This is actually encountered when @maxsibilla and @libpitt were tying to integrate the forked repo in SenNet with ingest-api. The fricrionless package currently being used is 4.0.0 (released over 2 years ago) and there's encoding issue.

File "/usr/src/app/src/./wsgi.py", line 1, in <module>
    from app import app as application
  File "/usr/src/app/src/./app.py", line 19, in <module>
    from routes.validation import validation_blueprint
  File "/usr/src/app/src/./routes/validation/__init__.py", line 8, in <module>
    ingest_validation_tools_upload = import_module('ingest_validation_tools.upload')
  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/src/app/src/./routes/validation/ingest_validation_tools/src/ingest_validation_tools/upload.py", line 8, in <module>
    from ingest_validation_tools.validation_utils import (
  File "/usr/src/app/src/./routes/validation/ingest_validation_tools/src/ingest_validation_tools/validation_utils.py", line 11, in <module>
    from ingest_validation_tools.table_validator import (
  File "/usr/src/app/src/./routes/validation/ingest_validation_tools/src/ingest_validation_tools/table_validator.py", line 6, in <module>
    import frictionless
  File "/usr/local/lib/python3.9/site-packages/frictionless/__init__.py", line 1, in <module>
    from .check import Check
  File "/usr/local/lib/python3.9/site-packages/frictionless/check.py", line 1, in <module>
    from .metadata import Metadata
  File "/usr/local/lib/python3.9/site-packages/frictionless/metadata.py", line 12, in <module>
    from .helpers import cached_property
  File "/usr/local/lib/python3.9/site-packages/frictionless/helpers.py", line 18, in <module>
    from . import config
  File "/usr/local/lib/python3.9/site-packages/frictionless/config.py", line 26, in <module>
    SCHEMA_PROFILE = json.loads(read_asset("profiles", "schema", "general.json"))
  File "/usr/local/lib/python3.9/site-packages/frictionless/config.py", line 13, in read_asset
    return io.open(os.path.join(dirname, "assets", *paths)).read().strip()
  File "/usr/lib64/python3.9/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 7807: ordinal not in range(128)
unable to load app 0 (mountpoint='') (callable not found or import error)

The frictionless developers had made a fix to address the encoding issue for read_asset() on Jan 13, 2022: https://github.com/frictionlessdata/framework/pull/966/files

I tested with upgrading to the latest 5.5.5 package and the error was gone. We should have a plan to upgrade this package. I don't know if there's going to be any breaking changes for the existing implementation when upgrading from 4.0.0 to 5.5.5. We need to find out.

Alternatively, we can just upgrade to a version released after that fix, https://github.com/frictionlessdata/framework/releases/tag/v4.23.1 and newer v4.x.y.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant