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

N°7216 import improves error handling missing or null data #612

Open
wants to merge 12 commits into
base: support/3.2
Choose a base branch
from

Conversation

accognet
Copy link
Contributor

internal

@accognet accognet added the bug Something isn't working label Feb 12, 2024
@accognet accognet self-assigned this Feb 12, 2024
@Molkobain Molkobain added the internal Work made by Combodo label Feb 12, 2024
@accognet accognet changed the base branch from develop to support/3.2 February 13, 2024 09:23
@accognet accognet changed the title Feature/7216 import improves error handling missing or null data N°7216 import improves error handling missing or null data Feb 27, 2024
@Hipska
Copy link
Contributor

Hipska commented Feb 28, 2024

Also,

IMPORTANT: Please follow the guidelines within this PR template before submitting it, it will greatly help us process your PR. 🙏
Any PRs not following the guidelines or with missing information will not be considered.

@rquetiez rquetiez self-requested a review June 7, 2024 12:03
@rquetiez
Copy link
Contributor

rquetiez commented Jun 7, 2024

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.

@Molkobain
Copy link
Member

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

@Molkobain Molkobain added this to the 3.3.0 milestone Jul 10, 2024
@Hipska
Copy link
Contributor

Hipska commented Jul 10, 2024

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 😉)

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

@Molkobain
Copy link
Member

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?

@Hipska
Copy link
Contributor

Hipska commented Jul 10, 2024

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

@Molkobain
Copy link
Member

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

@Hipska
Copy link
Contributor

Hipska commented Jul 10, 2024

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?

…or_handling_missing_or_null_data' into feature/7216-Import_improves_error_handling_missing_or_null_data

# Conflicts:
#	core/bulkchange.class.inc.php
#	dictionaries/fr.dictionary.itop.ui.php
@accognet accognet changed the base branch from support/3.2 to support/3.2-beta July 10, 2024 15:07
@accognet accognet changed the base branch from support/3.2-beta to support/3.2 July 10, 2024 15:07
@accognet
Copy link
Contributor Author

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.

@Hipska
Copy link
Contributor

Hipska commented Jul 10, 2024

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

@accognet
Copy link
Contributor Author

image

Copy link
Contributor

@Hipska Hipska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I was already suspecting it would be clear on which line the error occurs, this screenshot proves it.

dictionaries/en.dictionary.itop.ui.php Outdated Show resolved Hide resolved
core/bulkchange.class.inc.php Outdated Show resolved Hide resolved
@Hipska
Copy link
Contributor

Hipska commented Jul 11, 2024

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

@accognet
Copy link
Contributor Author

Yes, it's the same behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal Work made by Combodo
Projects
Status: Pending support PRs review
4 participants