iTop icon indicating copy to clipboard operation
iTop copied to clipboard

N°7216 import improves error handling missing or null data

Open accognet opened this issue 1 year ago • 16 comments

internal

accognet avatar Feb 12 '24 15:02 accognet

Also, https://github.com/Combodo/iTop/blob/4e53deec9d96093df87b233249a9c071ae458d40/.github/pull_request_template.md?plain=1#L3-L5

Hipska avatar Feb 28 '24 12:02 Hipska

Tests are missing. We've prototyped some tests in BulkChangeTest and it proved that the currrent implementation does handle only specific cases.

The following concerns have to be discussed and decided by Product Owers:

  1. What if a row has more cells than the first one? Currently, this is ignored. Should this be considered as an error too?
  2. The current implementation aims at raising errors when cells are missing. An alternative could be to consider those missing cells as the equivalent of . That option can be implemented in the CSV parser and that would involve less cases to test.

rquetiez avatar Jun 07 '24 12:06 rquetiez

Functional review: We rather have a clear error telling that the data are missing columns at line X.

Molkobain avatar Jul 10 '24 06:07 Molkobain

Yesterday, I stumbled across this very same problem. I didn't know a PR existed for it already because of the lack of a proper description. (Looking at you Anne-Catherine :wink:)

What will be the new situation with this PR if a row doesn't have the same number of columns?

Hipska avatar Jul 10 '24 07:07 Hipska

PR still have to be reworked, but the goal is that in case of a missing column in a line of your CSV, a clear error messgae will be displayed saying that a column is missing on line X. That way you wan fix the CSV data.

What do you think?

Molkobain avatar Jul 10 '24 08:07 Molkobain

I agree, but what is the current behaviour with this PR?

Hipska avatar Jul 10 '24 08:07 Hipska

I don't know, I think it displays an error, but I'll let @accognet answer.

Molkobain avatar Jul 10 '24 09:07 Molkobain

So why dit the functional team wrote this?

Functional review: We rather have a clear error telling that the data are missing columns at line X.

So, there must be some knowledge of what the current error would tell?

Hipska avatar Jul 10 '24 09:07 Hipska

The current behaviour of this PR is: If the number of columns in a row is not as expected, the import fails with a message like "Issue: Not the expected number of fields (current : 4 fields, expected :5)"

In functional review, we discussed the correct behavior in case of a missing column. Romain was convinced that we had changed the initial behavior of this PR during the technical review. And it wasn't. This explains Molkobain's confusing comment.

accognet avatar Jul 10 '24 15:07 accognet

Thanks, can you also put a screenshot of that error message please?

Hipska avatar Jul 10 '24 15:07 Hipska

image

accognet avatar Jul 10 '24 15:07 accognet

Does it also work if a row has too many fields?

Hipska avatar Jul 11 '24 07:07 Hipska

Yes, it's the same behavior

accognet avatar Jul 11 '24 07:07 accognet