Skip to main content

Connector plugin for flyte

Project description

🔗 Flyte Connectors Plugin

PyPI version License Tests Documentation

🚀 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:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-connector
  3. Write tests for your changes
  4. Ensure tests pass: pytest plugins/connectors/tests/
  5. Submit a pull request

Adding a New Connector

  1. Create your connector module in src/flyteplugins/connectors/
  2. Implement the TaskTemplate interface
  3. Add comprehensive tests in tests/
  4. Update this README with examples
  5. Add example usage in examples/connectors/

🔧 Requirements

  • Python: 3.10+
  • Flyte: Latest version
  • Dependencies: See pyproject.toml for full requirements

🆘 Support


Made with ❤️ by the Flyte Community

⭐ Star us on GitHub🐦 Follow us on Twitter💼 LinkedIn

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flyteplugins_connectors-2.0.0b46-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file flyteplugins_connectors-2.0.0b46-py3-none-any.whl.

File metadata

File hashes

Hashes for flyteplugins_connectors-2.0.0b46-py3-none-any.whl
Algorithm Hash digest
SHA256 0c19ff8ef184aa9880fec43a3f2acc440e6629a76bd1773b77215c2afa62ccc7
MD5 057af8957dc87e9842308eabb196a885
BLAKE2b-256 b0dc7497e9d9bfe79d056a247e72065c076ab7e4fc683152b4e00cfa16f91838

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page