confusing error if wrong extension
See original GitHub issueploomber infers the type of task with a combination of the source and product extension, but if there’s a typo a confusing error shows. example, if the user wants to dump data:
- source: another.sql
product: another.parquets # typo here
error:
ploomber.exceptions.SourceInitializationError: Error initializing SQLScriptSource('SELECT *\nFROM nu...ams"], "param") ]]') Loaded from: /Users/Edu/Desktop/sql/another.sql: The {{product}} placeholder is required. Example: 'CREATE TABLE {{product}} AS (SELECT * FROM ...)'
Fix: see if the value in product
has something similar to a .parquet
or .csv
extension and show an error
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
[BUG] Confusing error message about unknown extension ...
I roughly got this error when trying to push the extension to an organization that didn't have an app that supported Checkout Extensions....
Read more >A file is in a different format than its extension indicates in Excel
An issue with a file name extension might occur when a workbook that you are trying to open is unreadable and the contents...
Read more >C# compiler fails with misleading error when calling generic ...
When you create extension method for List<T> it can not be called for List<int> without telling method what is T . That's why...
Read more >Extension class giving error as Method does not exist or ...
I have written extension class for a page. Class is giving. error as "Error: Compile Error: Method does not exist or incorrect signature: ......
Read more >Inconsistent/wrong file type error messages in web uploader
The web uploader thinks that any file with MIME type image/* is acceptable, but that is not actually true and it's causing some...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
right. the
debug
is not supported in SQL tasks.As a recommendation for testing and debugging your implementation, add one test case here, you can use existing tasks as reference for building yours.
Essentially, you want to create a pipeline where one of the products has a wrong extension, then validate that the appropriate error is raised.
As a first step, write some sample test and ensure you get the original error:
Then, take it from there and test your implementation, ensure you have your dev environment correctly configured: https://github.com/ploomber/ploomber/blob/master/CONTRIBUTING.md
Then work on the implementation until the test passes, you can run individual tests like this:
I’ll add a few comments to the PR
@neelasha23 as a pointer, you can use this to compute string distance to see if the user had a typo (e.g. parque instead of parquet)