Skip to content

Commit

Permalink
Merge branch 'main' into feat/public-share-oss
Browse files Browse the repository at this point in the history
  • Loading branch information
hari-kuriakose authored Jul 15, 2024
2 parents c9c4530 + f88acbb commit f00fb3d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ repos:
- id: markdownlint-fix
args: [--disable, MD013]
- repo: https://github.com/pdm-project/pdm
rev: 2.15.4
rev: 2.16.1
hooks:
- id: pdm-lock-check
# - repo: local
Expand Down
13 changes: 12 additions & 1 deletion backend/workflow_manager/endpoint/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,17 @@ def handle_final_result(
results.append({"file": file_name, "result": result})

def load_file(self, input_file_path: str) -> tuple[str, BytesIO]:
"""Load file contnt and file name based on the file path.
Args:
input_file_path (str): source file
Raises:
InvalidSource: _description_
Returns:
tuple[str, BytesIO]: file_name , file content
"""
connector: ConnectorInstance = self.endpoint.connector_instance
connector_settings: dict[str, Any] = connector.connector_metadata
source_fs: fsspec.AbstractFileSystem = self.get_fsspec(
Expand All @@ -395,7 +406,7 @@ def load_file(self, input_file_path: str) -> tuple[str, BytesIO]:
file_content = remote_file.read()
file_stream = BytesIO(file_content)

return remote_file.key, file_stream
return os.path.basename(input_file_path), file_stream

@classmethod
def add_input_file_to_api_storage(
Expand Down

0 comments on commit f00fb3d

Please sign in to comment.