Skip to content

Ability to validate local data files against remote datapackage descriptor? #1435

@roll

Description

@roll

Overview

See this comment - #1416 (comment).

In v5 the basepath logic was unified so this is not possible anymore:

frictionless validate --basepath local/path/to/csvs \
https://raw.githubusercontent.com/mjacqu/glenglat/main/contribute/datapackage.yaml

The basepath will be just ignored as the data package is remote and it will have https://raw.githubusercontent.com/mjacqu/glenglat/main/contribute/ basepath.

In Python, it's possible to change this behavior (not tested for dialect/schema as a string):

package = Package('https://raw.githubusercontent.com/mjacqu/glenglat/main/contribute/datapackage.yaml')
for resource in package.resources:
  resource.basepath = 'local/path/to/csvs'
  print(resource.normpath)
  # local/path/to/csvs/borehole.csv
  # local/path/to/csvs/measurement.csv

Using this approach we can provide an argument like force-basepath to actions/program.validate (it's better to do this after v6 when CLI logic is rebased on using classes instead of actions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions