Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a debug mode to simplify quick bug analysis #840

Closed
roll opened this issue May 4, 2021 · 7 comments
Closed

Implement a debug mode to simplify quick bug analysis #840

roll opened this issue May 4, 2021 · 7 comments
Assignees
Labels
feature New functionality
Milestone

Comments

@roll
Copy link
Member

roll commented May 4, 2021

Overview

We need a debug mode available because errors are caught in a few places in the framework. For example, the CLI catches all the errors or Report.from_validate.

We might use an env var or a flag

@fjuniorr
Copy link
Contributor

fjuniorr commented Sep 10, 2021

@roll just to add additional motivation for this I've had a hard time tracking down a wrong delimiter (,) specified in the csv dialect of a resource when the actual csv file was using ;.

Here is an example of the message:

from frictionless import Package, validate_resource
from pprint import pprint

dp = Package('https://raw.githubusercontent.com/dados-mg/datapackage-reprex/bad-dialect-delimiter/datapackage.json')

report = validate_resource(dp.get_resource('pib-per-capita'))

pprint(report)
{'errors': [{'code': 'task-error',
             'description': 'General task-level error.',
             'message': "The task has an error: 'fieldPosition'",
             'name': 'Task Error',
             'note': "'fieldPosition'",
             'tags': []}],
 'stats': {'errors': 1, 'tasks': 0},
 'tasks': [],
 'time': 2.439,
 'valid': False,
 'version': '4.16.6'}

I think that this more obscure message has something to do with the fact that the resource pib-per-capita has a foreignKeys constraint, because the error in the other resource (ie. validate_resource(dp.get_resource('estados'))) is more clear.

Ps. I've found #903 in the process of investigating this problem and initially though they could be related. 😅

fjuniorr added a commit to transparencia-mg/etl-make that referenced this issue Nov 26, 2021
Essa mensagem de erro pouco informativa acontece quando o separador dos dados no arquivo csv não está de acordo com o especificado no dialect.json

Vide frictionlessdata/frictionless-py#840 para histórico
@roll roll added this to the v5 milestone Apr 24, 2022
@roll roll self-assigned this Apr 24, 2022
@roll roll added general General improvements and removed feature New functionality labels Apr 25, 2022
@roll roll removed this from the v5 milestone May 4, 2022
@roll roll assigned shashigharti and unassigned roll May 4, 2022
@roll roll added feature New functionality and removed general General improvements labels May 8, 2022
@roll roll assigned aivuk and unassigned shashigharti May 9, 2022
@aivuk
Copy link
Contributor

aivuk commented May 20, 2022

@roll What do you think a useful debug mode would be, just add some logging.debug where we currently have exceptions or are you thinking in something else?

@roll
Copy link
Member Author

roll commented May 22, 2022

For a starter,

$ frictionless validate table.csv --debug

that won't be swallowing exceptions as a part of validation report.

In general, it's about internal error reporting -- we don't need any interactive debugging etc ATM

@aivuk
Copy link
Contributor

aivuk commented May 27, 2022

Ok, if we don't swallow the exception, what we are going to do with it? I did some tests raising the exception on the CLI when a validation report was being created, but I don't see which additional information to add. Show the exception and which line it happened?

@roll
Copy link
Member Author

roll commented May 27, 2022

I think just letting the app fail with the exception would be a good start.

Another question - how to keep debug/not-debug state. I think we need to create a system.debug flag which can be set by users and in our case by CLI

@roll
Copy link
Member Author

roll commented Jun 3, 2022

Hi @aivuk,

Let's park this issue for now (moving to Blocked) as I'm reworking exception for v5 so we might not need to the way we discussed

@roll roll assigned roll and unassigned aivuk Jun 3, 2022
@roll roll added this to the v5 milestone Jul 3, 2022
@roll
Copy link
Member Author

roll commented Jul 9, 2022

DONE in #1119

@roll roll closed this as completed Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants