-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/error handling #30
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
Conversation
handling get entry exception
increase test coverage adding more tests removed use of reserved work 'type' changed to 'issue_type' handling of exception when API assumes that variables are in the correct state when accessing indexes
Codecov Report
@@ Coverage Diff @@
## dev #30 +/- ##
==========================================
+ Coverage 84.89% 86.71% +1.82%
==========================================
Files 5 5
Lines 503 512 +9
==========================================
+ Hits 427 444 +17
+ Misses 76 68 -8
Continue to review full report at Codecov.
|
…ct_id function catching config and script exceptions in initialise pipeline
fairdatapipeline/fdp_utils.py
Outdated
| """ | ||
| return list(filter(None, urlsplit(url).path.split("/")))[-1] | ||
| try: | ||
| return list(filter(None, urlsplit(url).path.split("/")))[-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list(filter( doesn't do anything in this context and is actually confusing, the purpose of this is to simply get the last element of a list, and if the list is empty raise an exception, as urlsplit(url).path.split("/") already returns a list that is all that is needed. I do not know why filter is being used at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, using your idea.
split_url_path = urlsplit(url).path.split("/")
if not split_url_path:
raise IndexError(f"Unable to extract ID from registry URL: {url}")
return [s for s in split_url_path if s.strip() != ''][-1]
|
Kudos, SonarCloud Quality Gate passed!
|








relates to #13