Commit 13e266e1 authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Update software dependencies

parent 58c2d94f
......@@ -22,11 +22,11 @@ et-xmlfile==1.0.1
# via openpyxl
ezodf==0.3.2
# via validata_core (setup.py)
frictionless==3.48.0
frictionless==4.0.0a13
# via validata_core (setup.py)
idna==2.10
# via requests
importlib-resources==5.0.0
importlib-resources==5.1.0
# via validata_core (setup.py)
isodate==0.6.0
# via frictionless
......@@ -36,11 +36,11 @@ jsonschema==3.2.0
# via frictionless
lxml==4.6.2
# via validata_core (setup.py)
numpy==1.19.5
numpy==1.20.0
# via pandas
openpyxl==3.0.6
# via validata_core (setup.py)
pandas==1.2.0
pandas==1.2.1
# via tablib
petl==1.7.1
# via frictionless
......@@ -54,15 +54,15 @@ python-slugify==4.0.1
# via frictionless
python-stdnum==1.15
# via validata_core (setup.py)
pytz==2020.5
pytz==2021.1
# via pandas
pyyaml==5.3.1
pyyaml==5.4.1
# via frictionless
requests==2.25.1
# via
# frictionless
# validata_core (setup.py)
shellingham==1.3.2
shellingham==1.4.0
# via typer
simpleeval==0.9.10
# via frictionless
......@@ -82,7 +82,7 @@ toolz==0.11.1
# via validata_core (setup.py)
typer[all]==0.3.2
# via frictionless
urllib3==1.26.2
urllib3==1.26.3
# via requests
validators==0.18.2
# via frictionless
......
......@@ -194,8 +194,10 @@ def validate_csv_bytes(csv_bytes_source, schema):
def test_empty_file(schema_abc):
source = b""
report = validate_csv_bytes(source, schema_abc)
assert report["tasks"][0]["errors"][0]["code"] == "source-error"
try:
report = validate_csv_bytes(source, schema_abc)
except ValueError:
pass
def test_valid_delimiter(schema_abc):
......
......@@ -33,10 +33,7 @@ class ValidataResource(ABC):
bytes_data.decode("utf-8")
return "utf-8"
except UnicodeDecodeError:
encoding = frictionless.helpers.detect_encoding(
bytes_data,
confidence=frictionless.config.DEFAULT_ENCODING_CONFIDENCE,
)
encoding = frictionless.Detector().detect_encoding(bytes_data)
return encoding.lower() if encoding else None
......@@ -104,7 +101,7 @@ class FileContentValidataResource(ValidataResource):
def _extract_header_and_rows_from_frictionless_source(source, **source_options):
"""Extract header and data rows from frictionless source and options."""
with frictionless.Resource(source, **source_options) as res:
rows = list(res.data_stream)
rows = list(res.list_stream)
if not rows:
raise ValueError("Empty source")
return rows[0], rows[1:]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment