Skip to content

Commit af5806a

Browse files
authored
Merge pull request #257 from astronomy-commons/fix-full-file-pointer
Prepend file protocol to pointer
2 parents 10e527d + 5adde76 commit af5806a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/hipscat/io/file_io/file_pointer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ def get_file_pointer_for_fs(protocol: str, file_pointer: FilePointer) -> FilePoi
8080
return FilePointer(split_pointer)
8181

8282

83-
def get_full_file_pointer(incomplete_path: str, protocol_path: str) -> FilePointer:
83+
def get_full_file_pointer(path: str, protocol_path: str) -> FilePointer:
8484
"""Rebuilds the file_pointer with the protocol and account name if required"""
8585
protocol = get_file_protocol(protocol_path)
86-
return FilePointer(f"{protocol}://{incomplete_path}")
86+
if not path.startswith(protocol):
87+
path = f"{protocol}://{path}"
88+
return FilePointer(path)
8789

8890

8991
def get_file_pointer_from_path(path: str, include_protocol: str = None) -> FilePointer:

0 commit comments

Comments
 (0)