Edit page in Livemark
(2022-09-19 18:33)

Other Classes

Error

The Error class is a metadata with no behavior. It's used to describe an error that happened during Framework work or during the validation.

To create a custom error you basically just need to fill the required class fields:

from frictionless import errors

class DuplicateRowError(errors.RowError):
    code = "duplicate-row"
    name = "Duplicate Row"
    tags = ["#table", "#row", "#duplicate"]
    template = "Row at position {rowPosition} is duplicated: {note}"
    description = "The row is duplicated."

Stats

The Stats represent various describe/validate stats:

from frictionless import describe

resource = describe('table.csv', stats=True)
print(resource.stats)
{'md5': '6c2c61dd9b0e9c6876139a449ed87933',
 'sha256': 'a1fd6c5ff3494f697874deeb07f69f8667e903dd94a7bc062dd57550cea26da8',
 'bytes': 30,
 'fields': 2,
 'rows': 2}

Reference

Error (class)

Stats (class)

Error (class)

Error representation

Signature

(*, note: str) -> None

Parameters

  • note (str)

error.type (property)

NOTE: add docs

Signature

ClassVar[str]

error.title (property)

NOTE: add docs

Signature

ClassVar[str]

error.description (property)

NOTE: add docs

Signature

ClassVar[str]

error.template (property)

NOTE: add docs

Signature

ClassVar[str]

error.tags (property)

NOTE: add docs

Signature

ClassVar[List[str]]

error.message (property)

NOTE: add docs

Signature

str

error.note (property)

NOTE: add docs

Signature

str

Stats (class)

Metadata represenation

Signature

(*, md5: Optional[str] = None, sha256: Optional[str] = None, bytes: Optional[int] = None, fields: Optional[int] = None, rows: Optional[int] = None, tasks: Optional[int] = None, warnings: Optional[int] = None, errors: Optional[int] = None, seconds: Optional[float] = None) -> None

Parameters

  • md5 (Optional[str])
  • sha256 (Optional[str])
  • bytes (Optional[int])
  • fields (Optional[int])
  • rows (Optional[int])
  • tasks (Optional[int])
  • warnings (Optional[int])
  • errors (Optional[int])
  • seconds (Optional[float])

stats.md5 (property)

NOTE: add docs

Signature

Optional[str]

stats.sha256 (property)

NOTE: add docs

Signature

Optional[str]

stats.bytes (property)

NOTE: add docs

Signature

Optional[int]

stats.fields (property)

NOTE: add docs

Signature

Optional[int]

stats.rows (property)

NOTE: add docs

Signature

Optional[int]

stats.tasks (property)

NOTE: add docs

Signature

Optional[int]

stats.warnings (property)

NOTE: add docs

Signature

Optional[int]

stats.errors (property)

NOTE: add docs

Signature

Optional[int]

stats.seconds (property)

NOTE: add docs

Signature

Optional[float]

It's a beta version of Frictionless Framework (v5). Read Frictionless Framework (v4) docs for a version that is currently installed by default by pip.