Skip to content
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

feat/databricks volumes src #3171

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

rbiseck3
Copy link
Contributor

@rbiseck3 rbiseck3 commented Jun 10, 2024

Description

This adds in a source connector to list and download files from UC Volumes using the dbfs utilts in the SDK.
Example:

from unstructured.ingest.v2.processes.connectors.databricks_volumes import (
    DatabricksVolumesDownloader,
    DatabricksVolumesIndexer,
    DatabricksVolumesIndexerConfig,
    DatabricksVolumesDownloaderConfig,
    DatabricksVolumesAccessConfig,
    DatabricksVolumesConnectionConfig,
)
import os
from pathlib import Path

connection_configs = DatabricksVolumesConnectionConfig(
    host=os.getenv("DATABRICKS_HOST"),
    access_config=DatabricksVolumesAccessConfig(
        token=os.getenv("DATABRICKS_TOKEN"),
    ),
)
indexer = DatabricksVolumesIndexer(
    connection_config=connection_configs,
    index_config=DatabricksVolumesIndexerConfig(
        remote_url="/Volumes/unstructured_solutions/unstructured_test_schema/unstructured-volume"
    ),
)
downloader = DatabricksVolumesDownloader(
    connection_config=connection_configs,
    download_config=DatabricksVolumesDownloaderConfig(
        download_dir=Path("/Users/romanisecke/Downloads/databricks-download")
    ),
)

for f in indexer.run():
    downloader.run(file_data=f)

@rbiseck3 rbiseck3 changed the title Feat/databricks volumes src feat/databricks volumes src Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant