Connector plugin for flyte
Project description
🔗 Flyte Connectors Plugin
🚀 Seamlessly connect Flyte workflows to external data sources and services
Build powerful data pipelines with native integrations to popular cloud services
🚀 Quick Start
Installation
pip install --pre flyteplugins-connectors[bigquery] # Install BigQuery connector
BigQuery Integration
Execute SQL queries on BigQuery and seamlessly integrate results into your Flyte workflows:
from flyteplugins.connectors.bigquery.task import BigQueryConfig, BigQueryTask
import flyte
from flyte.io import DataFrame
# Configure your BigQuery connection
config = BigQueryConfig(
ProjectID="your-gcp-project",
Location="US" # Optional: specify region
)
# Create a task environment
env = flyte.TaskEnvironment(name="analytics_env")
# Define your BigQuery task
analytics_task = BigQueryTask(
name="user_analytics",
inputs={
"user_id": int,
"start_date": str,
"end_date": str
},
output_dataframe_type=DataFrame,
plugin_config=config,
query_template="""
SELECT
user_id,
COUNT(*) as event_count,
MAX(timestamp) as last_activity
FROM events
WHERE user_id = {{ .user_id }}
AND DATE(timestamp) BETWEEN '{{ .start_date }}' AND '{{ .end_date }}'
GROUP BY user_id
"""
)
env.from_task(analytics_task)
# Run your workflow
if __name__ == "__main__":
flyte.init_from_config()
result = flyte.with_runcontext(mode="remote").run(
analytics_task,
user_id=12345,
start_date="2024-01-01",
end_date="2024-01-31"
)
print(f"Workflow URL: {result.url}")
📚 Available Connectors
| Connector | Status | Description | Use Cases |
|---|---|---|---|
| 🔷 BigQuery | ✅ Stable | Google Cloud data warehouse | Analytics, ML training, reporting |
| 🔗 More Coming Soon | 🚧 | Additional connectors in development | - |
🧪 Testing
Run the test suite to ensure everything works correctly:
# Run all connector tests
pytest plugins/connectors/tests/ -v
# Run specific connector tests
pytest plugins/connectors/tests/test_bigquery.py -v
# Run with coverage
pytest plugins/connectors/tests/ --cov=flyteplugins.connectors --cov-report=html
🤝 Contributing
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-connector - Write tests for your changes
- Ensure tests pass:
pytest plugins/connectors/tests/ - Submit a pull request
Adding a New Connector
- Create your connector module in
src/flyteplugins/connectors/ - Implement the
TaskTemplateinterface - Add comprehensive tests in
tests/ - Update this README with examples
- Add example usage in
examples/connectors/
🔧 Requirements
- Python: 3.10+
- Flyte: Latest version
- Dependencies: See
pyproject.tomlfor full requirements
🆘 Support
- 📬 Community: Flyte Slack
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📚 Documentation: docs.flyte.org
Made with ❤️ by the Flyte Community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flyteplugins_connectors-2.0.0b41-py3-none-any.whl.
File metadata
- Download URL: flyteplugins_connectors-2.0.0b41-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fa3f16a13f8e86673f7b59cdd13487c7245fd78077e5258c65687e954d55ae7
|
|
| MD5 |
d273c7a741ef234c1cbaa1e5231d7caf
|
|
| BLAKE2b-256 |
669f6769ff1c456a195eac764e469be0af962695d5f39461c176f37ed1b816c2
|