frictionlessdata / frictionless-ci

Data management service that brings continuous data validation to tabular data in your repository via Github Action
https://repository.frictionlessdata.io
MIT License
36 stars 12 forks source link

Import error when running Github Action workflow for data validation #25

Closed augusto-herrmann closed 2 years ago

augusto-herrmann commented 2 years ago

Overview

In our repository the validation workflow is failing with an import error when running frictionless validate inquiry.json --json. See the error report.

Our frictionless.yaml workflow for Frictionless Repository is pretty much the default one: https://github.com/okfn/publicbodies/blob/master/.github/workflows/frictionless.yaml

jmcastagnetto commented 2 years ago

Same issue observed yesterday when validating using the frictionless github action, the problem seems to be an import for the click.termui python library:

From: https://github.com/jmcastagnetto/covid-19-peru-vacunas/actions/runs/2055954381

[validate](https://github.com/jmcastagnetto/covid-19-peru-vacunas/runs/5730354742?check_suite_focus=true)
Cannot validate inquiry: Command failed: frictionless validate inquiry.json --json
Traceback (most recent call last):
  File "/usr/local/bin/frictionless", line 5, in <module>
    from frictionless.__main__ import program
  File "/usr/local/lib/python3.10/site-packages/frictionless/__init__.py", line 20, in <module>
    from .program import program
  File "/usr/local/lib/python3.10/site-packages/frictionless/program/__init__.py", line 1, in <module>
    from .api import program_api
  File "/usr/local/lib/python3.10/site-packages/frictionless/program/api.py", line 1, in <module>
    from typer import Option as Opt
  File "/usr/local/lib/python3.10/site-packages/typer/__init__.py", line 12, in <module>
    from click.termui import get_terminal_size as get_terminal_size
ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/usr/local/lib/python3.10/site-packages/click/termui.py)

YAML at: https://github.com/jmcastagnetto/covid-19-peru-vacunas/blob/main/.github/frictionless.yaml

Using the same YAML definition and running locally on my laptop, the frictionless validation works.

augusto-herrmann commented 2 years ago

Yes, local validation with the frictionless framework works in my case as well.

AT-SyT commented 2 years ago

I also encountered this problem today. It works if I pin click to version 8.0.4. This issue seems to be related to the 8.1.0 release of click on the 28th of March (https://pypi.org/project/click/#history)

gabrielbdornas commented 2 years ago

It seems to be related to the click 8.1.0 version as mentioned here also.

jmcastagnetto commented 2 years ago

With the info given by @AT-SyT, I checked my local click, and I have 8.0.3, had not updated it yet (and for now, I won't)

tiangolo commented 2 years ago

I just released Typer 0.4.1 that should handle the Typer issue. :rocket: :nerd_face:

jmcastagnetto commented 2 years ago

I can confirm that now the action is working again (did not downgrade click) See: https://github.com/jmcastagnetto/covid-19-peru-vacunas/actions/runs/2066912541

augusto-herrmann commented 2 years ago

I too have just re-run the latest job and it is now working.

Unless anyone raises any objections or concerns, I'm soon going to close this issue as solved.