We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da633cf commit 126960dCopy full SHA for 126960d
fairdatapipeline/fdp_utils.py
@@ -104,10 +104,11 @@ def extract_id(url: str) -> str:
104
Returns:
105
| str: id derrived from the url
106
"""
107
- try:
108
- return list(filter(None, urlsplit(url).path.split("/")))[-1]
109
- except IndexError:
110
- raise IndexError(f"Unable to index input url: {url}")
+
+ split_url_path = urlsplit(url).path.split("/")
+ if not split_url_path:
+ raise IndexError(f"Unable to extract ID from registry URL: {url}")
111
+ return [s for s in split_url_path if s != ""][-1]
112
113
114
def post_entry(
0 commit comments