Collection of tasks to interact with MetricFlow
Project description
prefect-metricflow
Welcome!
Collection of tasks to interact with MetricFlow
Getting Started
Python setup
Requires an installation of Python 3.7+.
We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.
These tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the Prefect documentation.
Installation
Install prefect-metricflow
with pip
:
pip install prefect-metricflow
Write and run a flow
from prefect import flow
from prefect_metricflow.tasks import (
materialize
)
@flow
def create_materialization_with_metricflow():
return materialize(
materialization_name="my_materialization",
config={
"dwh_dialect": "redshift",
"dwh_host": "host",
"dwh_port": 5439,
"dwh_user": "dw_user",
"dwh_password": "dw_pwd",
"dwh_database": "dw_db",
"dwh_schema": "dw_schema",
"model_path": "path/to/models",
}
)
create_materialization_with_metricflow()
@flow
def drop_materialization_with_metricflow():
return drop_materialization(
materialization_name="my_materialization",
config={
"dwh_dialect": "redshift",
"dwh_host": "host",
"dwh_port": 5439,
"dwh_user": "dw_user",
"dwh_password": "dw_pwd",
"dwh_database": "dw_db",
"dwh_schema": "dw_schema",
"model_path": "path/to/models",
}
)
drop_materialization_with_metricflow()
Resources
If you encounter any bugs while using prefect-metricflow
, feel free to open an issue in the prefect-metricflow repository.
If you have any questions or issues while using prefect-metricflow
, you can find help in either the Prefect Discourse forum or the Prefect Slack community.
Development
If you'd like to install a version of prefect-metricflow
for development, clone the repository and perform an editable install with pip
:
git clone https://github.com/AlessandroLollo/prefect-metricflow.git
cd prefect-metricflow/
pip install -e ".[dev]"
# Install linting pre-commit hooks
pre-commit install
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 Distribution
Built Distribution
File details
Details for the file prefect-metricflow-0.1.1.tar.gz
.
File metadata
- Download URL: prefect-metricflow-0.1.1.tar.gz
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b8aa83be3562ee5e452739148ce166eb04a28707568465f8393abda8a243d8c |
|
MD5 | d3b75ee157165cbe5009f7b155b99c46 |
|
BLAKE2b-256 | e63d03adca75f4bc23c2946556814778de5b89a163d6242ac509d700b568813e |
File details
Details for the file prefect_metricflow-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: prefect_metricflow-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ccbf43c999e4468ec595165ff1a6ab9b2cde6943ab11aad1b1bb43c234acc23 |
|
MD5 | 62d7ab00fdfb01169a419dc571649e26 |
|
BLAKE2b-256 | 9c66c29cf28ce8e7a339ae272418ae4c33abfcebf0c797db168d33bd70b7fadd |