Skip to content

Commit

Permalink
Fix sftp connector
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiseck3 committed May 22, 2024
1 parent 21c24f9 commit e7786bc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion unstructured/ingest/v2/processes/connectors/fsspec/sftp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import os
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Generator, Optional
Expand Down Expand Up @@ -30,7 +31,14 @@

@dataclass
class SftpIndexerConfig(FsspecIndexerConfig):
pass
def __post_init__(self):
super().__post_init__()
_, ext = os.path.splitext(self.remote_url)
parsed_url = urlparse(self.remote_url)
if ext:
self.path_without_protocol = Path(parsed_url.path).parent.as_posix().lstrip("/")
else:
self.path_without_protocol = parsed_url.path.lstrip("/")


@dataclass
Expand Down

0 comments on commit e7786bc

Please sign in to comment.