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

Bulk update silently ignores mis-spelled header fields #13773

Closed
peteeckel opened this issue Sep 15, 2023 · 4 comments
Closed

Bulk update silently ignores mis-spelled header fields #13773

peteeckel opened this issue Sep 15, 2023 · 4 comments
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@peteeckel
Copy link
Contributor

peteeckel commented Sep 15, 2023

NetBox version

3.6.1

Python version

3.11

Steps to Reproduce

Try to change the name of some existing items, e.g. inventory items, using a header field that does not exactly match a field name of the corresponding model.

The data I stumbled across this was

id,Name
1,charon xcvr 8
2,charon xcvr 9
3,charon xcvr 10
4,charon xcvr 11
5,charon xcvr 12
6,charon xcvr 15

Note the capitalised Name instead of name.

Expected Behavior

NetBox displays an error message about the field having an incorrect name.

Observed Behavior

The input is accepted, but the data entered is silently ignored.

@peteeckel peteeckel added the type: bug A confirmed report of unexpected behavior in the application label Sep 15, 2023
@peteeckel peteeckel changed the title Bulk import silently ignores mis-spelled header fields Bulk update silently ignores mis-spelled header fields Sep 15, 2023
@pv2b
Copy link
Contributor

pv2b commented Sep 15, 2023

This isn't a bug, it's a feature. This allows a CSV file to be imported into NetBox that might contain extra fields that NetBox might not care about. So maybe this should be an FR?

However, I will agree that maybe it makes sense to make the header name matching case-insensitive at least? That's bitten me a few times.

@peteeckel
Copy link
Contributor Author

peteeckel commented Sep 15, 2023

I see the advantage of being able to ignore extra fields, but at least the very least there should be a warning or notice (along the lines of "Ignored non model fields Name, ...") about it. Silently ignoring the fields leaves the user in the dark about what happened.

Case insensitivity would also be a good thing, I agree.

@pv2b
Copy link
Contributor

pv2b commented Sep 15, 2023

In that case, that sounds like it could be the basis for at least two FR's.

  1. Make CSV importer case-insensitive
  2. Add a notification when finding unrecognized fields in an import

And maybe even

  1. Allow the user to confirm/preview the import before actually processing it. (Similar to what scripts can do right now with "dry runs".)

@peteeckel
Copy link
Contributor Author

In that case, that sounds like it could be the basis for at least two FR's.

I'll do my best :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants