Skip to content

Commit

Permalink
Save file id for all fsspec connectors if present
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiseck3 committed Jul 18, 2024
1 parent 5d38703 commit ee254c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions unstructured/ingest/v2/processes/connectors/fsspec/fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ def get_metadata(self, path: str) -> DataSourceMetadata:
"protocol": self.index_config.protocol,
"remote_file_path": self.index_config.remote_url,
}
file_stat = self.fs.stat(path=path)
if file_id := file_stat.get("id"):
record_locator["file_id"] = file_id
if metadata:
record_locator["metadata"] = metadata
return DataSourceMetadata(
Expand Down

0 comments on commit ee254c3

Please sign in to comment.