Fix CSV format check to use file_format and correct error message#1336
Open
Ritinikhil wants to merge 2 commits intoapache:mainfrom
Open
Fix CSV format check to use file_format and correct error message#1336Ritinikhil wants to merge 2 commits intoapache:mainfrom
Ritinikhil wants to merge 2 commits intoapache:mainfrom
Conversation
In build_table, after computing file_format = extension.lstrip(".").lower(), the code uses elif format == "csv": and later references format in error messages. format is the Python built-in, not the local variable; this branch never matches, so CSV inputs always fall through to the generic “not supported” error.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an error message in the LocationInputPlugin.build_table method to correctly reference the file_format variable instead of the undefined format variable, and improves message readability by removing an awkward line continuation.
Changes:
- Updated the unsupported file format error message to use
file_formatvariable and improved formatting
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kosiew
requested changes
Jan 19, 2026
Contributor
kosiew
left a comment
There was a problem hiding this comment.
Thanks for contributing.
Can you add some tests:
- for CSV file input
- edge cases (no extension, uppercase CSV, etc..)
Author
|
Ok, I will do it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LocationInputPlugin.build_tableto compare againstfile_formatinstead of the built-informat.file_format.Testing
Issue
Closes #.