Custom Drive Connector
Just like other services in OpenMetadata (Database, Pipelines, Dashboards, Messaging, etc.), it’s possible to create a Custom Drive Connector to bring metadata from a storage or file system-like service into OpenMetadata.
In this guide, we'll walk through how to implement your own Custom Drive Connector by extending the ingestion framework. The implementation pattern follows other service types closely, making the transition smooth for anyone familiar with the ecosystem.
This guide is based on a working example in the OpenMetadata Demos repository: link.
Watch OpenMetadata's Webinar on Custom Connectors to get more context on how to build these integrations.
Steps to Set Up a Custom Drive Connector
Step 1 - Prepare Your Drive Connector
A Custom Drive Connector is a Python class that inherits from:
It must implement required methods such as:
prepare_itertest_connection(optional but recommended so the UI can validate access)
Inside my_drive_connector.py, define your class:
_iter is a generator that produces the CreateEntityRequest instances expected by the ingestion framework.
For more on the ingestion framework, refer to the OpenMetadata Ingestion Workflow Docs
Step 2 - Yield Drive Data as Entities
You need to yield CreateEntityRequest objects wrapped in an Either type. This pattern handles both successful entity creation and errors.
Import necessary types:
Example usage:
Extend the same pattern with CreateSpreadsheetRequest and CreateWorksheetRequest if your Drive service exposes those concepts.
Step 3 - Package Your Custom Drive Connector
To use the connector, package it as a Python module. A minimal setup.py may look like:
Build the package:
Step 4 - Update the Ingestion Image
To run your Custom Drive Connector inside Docker (e.g., with Airflow or directly from the UI), the ingestion image must include your module.
Dockerfile example:
This ensures that your code is baked into the ingestion container. Always align the ingestion image tag with the OpenMetadata version that is running your server/UI.
Step 5 - Run OpenMetadata with Custom Image
If you're using Docker Compose, update your setup to use the new image.
Step 6 - Configure Custom Drive in OpenMetadata UI
- Navigate to Drive Services
- Click Add New Service > Custom
- Enter your Source Python Class as:
Ensure the full module path is specified so OpenMetadata can import the connector.
