Download tasks/codeql_python_benchmark51_v2/pyvul-07332271886167133edf/patch.diff from Benchanything/checkerbench: direct link, hf CLI and curl.
- Browser
- Download file 1.39 kB
-
https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_python_benchmark51_v2/pyvul-07332271886167133edf/patch.diff
- Command line
-
hf download hf://datasets/Benchanything/checkerbench/tasks/codeql_python_benchmark51_v2/pyvul-07332271886167133edf/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_python_benchmark51_v2/pyvul-07332271886167133edf/patch.diff
1.39 kB
| diff --git a/mlflow/utils/uri.py b/mlflow/utils/uri.py | |
| index eb59148cc..331648b8e 100644 | |
| --- a/mlflow/utils/uri.py | |
| +++ b/mlflow/utils/uri.py | |
| def is_local_uri(uri, is_tracking_or_registry_uri=True): | |
| return False | |
| parsed_uri = urllib.parse.urlparse(uri) | |
| + scheme = parsed_uri.scheme | |
| + if scheme == "": | |
| + return True | |
| + | |
| if parsed_uri.hostname and not ( | |
| parsed_uri.hostname == "." | |
| or parsed_uri.hostname.startswith("localhost") | |
| def is_local_uri(uri, is_tracking_or_registry_uri=True): | |
| ): | |
| return False | |
| - scheme = parsed_uri.scheme | |
| - if scheme == "" or scheme == "file": | |
| + if scheme == "file": | |
| return True | |
| if is_windows() and len(scheme) == 1 and scheme.lower() == pathlib.Path(uri).drive.lower()[0]: | |
| diff --git a/tests/utils/test_uri.py b/tests/utils/test_uri.py | |
| index 758642e9b..b776795c6 100644 | |
| --- a/tests/utils/test_uri.py | |
| +++ b/tests/utils/test_uri.py | |
| def test_is_local_uri(): | |
| assert is_local_uri("file://localhost:5000/mlruns") | |
| assert is_local_uri("file://127.0.0.1/mlruns") | |
| assert is_local_uri("file://127.0.0.1:5000/mlruns") | |
| + assert is_local_uri("//proc/self/root") | |
| + assert is_local_uri("/proc/self/root") | |
| assert not is_local_uri("file://myhostname/path/to/file") | |
| assert not is_local_uri("https://whatever") | |