-
Notifications
You must be signed in to change notification settings - Fork 1
Eg.ovh #86
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
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # transparentpath/gcsutils/transparentpath.py
comment : test not ssh in pull-request.yml
| @@ -0,0 +1,76 @@ | |||
| import importlib.util | |||
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.
Regroupe test_ssh.py in test.py
| @@ -0,0 +1,16 @@ | |||
| #!/usr/bin/expect -f | |||
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.
change suffix to .exp : it is not bash
or remove if useless
| "If using a path starting with 'gs://', you must include the bucket name in it unless it" | ||
| f"If using a path starting with {TransparentPath.remote_prefix[prefix]}, you must include the bucket " | ||
| f"name in it unless it " | ||
| "is specified with bucket= or if TransparentPath already has been set to use a specified bucket" |
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.
This error message does not make sense if using SSH : no bucket
| path: Pathlib.Path | ||
| Only relevant if the method was called from TransparentPath.__init__() : will attempts to fetch the bucket | ||
| from the path if bucket is not given | ||
| fs_kind: str Returns GCSFileSystem if 'gcs_*', LocalFilsSystem if 'local', `fsspec.implementations.local.SFTPFileSystem`. |
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.
Line breaks are here for a reason...
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.
And missing a "if 'ssh'"
| ------- | ||
| Tuple[Union[gcsfs.GCSFileSystem, LocalFileSystem], Union[None, str], Union[None, str], Union[None, str]] | ||
| The FileSystem object, the project if on GCS else None, and the bucket if on GCS. | ||
| Tuple[Union[gcsfs.GCSFileSystem, LocalFileSystem, |
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.
The returned tuple is of size 3, but the doc indicates 4. Fix the doc. Plus, the typing hint and the doc do not match. Fix both.
| @property | ||
| def buckets(self) -> List[str]: | ||
| if self.fs_kind == "local": | ||
| if self.fs_kind == "local" or self.fs_kind == "ssh": |
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.
if in () blablabla
| if self.fs_kind.startswith("gcs") and self.is_file(): | ||
| obj = str(self).replace(TransparentPath.remote_prefix, "").replace(" ", "%20") | ||
| return f"https://storage.cloud.google.com/{obj}" | ||
| if self.fs_kind != "local" and self.fs_kind != "ssh" and self.is_file(): |
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.
if not in () blablabla
| @property | ||
| def download(self) -> Union[None, str]: | ||
| """Returns a clickable link to download the file from GCS. | ||
| """Returns a clickable link to download the file from remote. |
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.
is it not implementable for ssh ? Maybe not, but it is worth checking
| postfix = f";tab=objects?project={project}" | ||
| else: | ||
| return None | ||
| if self.fs_kind != "local" and self.fs_kind != "ssh": |
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.
why not replace
if self.fs_kind != "local" and self.fs_kind != "ssh":
if self.fs_kind == "gcs":by simply
if self.fs_kind == "gcs":?
| raise ValueError("open method needs arguments.") | ||
| thefile = args[0] | ||
| if type(thefile) == str and "gs://" in thefile: | ||
| if type(thefile) == str and ("gs://" in thefile): |
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.
mabye this condition should also handle ssh : I do not think doing open("sftp://...") actually works, you would here too need to use a transparentpath
add ssh