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

Inquiry Class

The Inquiry gives you an ability to create arbitrary validation jobs containing a set of individual validation tasks.

Creating Inquiry

Let's create an inquiry that includes an individual file validation and a resource validation:

from frictionless import Inquiry

inquiry = Inquiry.from_descriptor({'tasks': [
  {'path': 'capital-valid.csv'},
  {'path': 'capital-invalid.csv'},
]})
inquiry.to_yaml('capital.inquiry-example.yaml')
print(inquiry)
{'tasks': [{'path': 'capital-valid.csv'}, {'path': 'capital-invalid.csv'}]}

Validating Inquiry

Tasks in the Inquiry accept the same arguments written in camelCase as the corresponding validate functions have. As usual, let' run validation:

frictionless validate capital.inquiry-example.yaml
# -------
# invalid: ['capital.inquiry-example.yaml']
# -------
type            message
--------------  ----------------------------------------------------------------------------------
resource-error  The data resource has an error: one of the properties "path" or "data" is required

At first sight, it's no clear why such a construct exists but when your validation workflow gets complex, the Inquiry can provide a lot of flexibility and power. Last but not least, the Inquiry will use multiprocessing if there are more than 1 task provided.

Reference

Inquiry (class)

InquiryTask (class)

Inquiry (class)

Inquiry representation.

Signature

(name: Optional[str] = None, title: Optional[str] = None, description: Optional[str] = None, tasks: List[InquiryTask] = NOTHING) -> None

Parameters

  • name (Optional[str])
  • title (Optional[str])
  • description (Optional[str])
  • tasks (List[InquiryTask])

inquiry.name (property)

NOTE: add docs

Signature

Optional[str]

inquiry.title (property)

NOTE: add docs

Signature

Optional[str]

inquiry.description (property)

NOTE: add docs

Signature

Optional[str]

inquiry.tasks (property)

List of underlaying tasks

Signature

List[InquiryTask]

inquiry.validate (method)

Validate inquiry

Signature

(*, parallel=False)

Parameters

  • parallel

InquiryTask (class)

Inquiry task representation.

Signature

(name: Optional[str] = None, type: Optional[str] = None, path: Optional[str] = None, scheme: Optional[str] = None, format: Optional[str] = None, encoding: Optional[str] = None, mediatype: Optional[str] = None, compression: Optional[str] = None, extrapaths: Optional[List[str]] = None, innerpath: Optional[str] = None, dialect: Optional[Dialect] = None, schema: Optional[Schema] = None, checklist: Optional[Checklist] = None, resource: Optional[str] = None, package: Optional[str] = None) -> None

Parameters

  • name (Optional[str])
  • type (Optional[str])
  • path (Optional[str])
  • scheme (Optional[str])
  • format (Optional[str])
  • encoding (Optional[str])
  • mediatype (Optional[str])
  • compression (Optional[str])
  • extrapaths (Optional[List[str]])
  • innerpath (Optional[str])
  • dialect (Optional[Dialect])
  • schema (Optional[Schema])
  • checklist (Optional[Checklist])
  • resource (Optional[str])
  • package (Optional[str])

inquiryTask.name (property)

NOTE: add docs

Signature

Optional[str]

inquiryTask.type (property)

NOTE: add docs

Signature

Optional[str]

inquiryTask.path (property)

NOTE: add docs

Signature

Optional[str]

inquiryTask.scheme (property)

NOTE: add docs

Signature

Optional[str]

inquiryTask.format (property)

NOTE: add docs

Signature

Optional[str]

inquiryTask.encoding (property)

NOTE: add docs

Signature

Optional[str]

inquiryTask.mediatype (property)

NOTE: add docs

Signature

Optional[str]

inquiryTask.compression (property)

NOTE: add docs

Signature

Optional[str]

inquiryTask.extrapaths (property)

NOTE: add docs

Signature

Optional[List[str]]

inquiryTask.innerpath (property)

NOTE: add docs

Signature

Optional[str]

inquiryTask.dialect (property)

NOTE: add docs

Signature

Optional[Dialect]

inquiryTask.schema (property)

NOTE: add docs

Signature

Optional[Schema]

inquiryTask.checklist (property)

NOTE: add docs

Signature

Optional[Checklist]

inquiryTask.resource (property)

NOTE: add docs

Signature

Optional[str]

inquiryTask.package (property)

NOTE: add docs

Signature

Optional[str]

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.