diff --git a/docs/content/_apidocs.mdx b/docs/content/_apidocs.mdx index b89795bba5629..48246fa857011 100644 --- a/docs/content/_apidocs.mdx +++ b/docs/content/_apidocs.mdx @@ -610,6 +610,16 @@ Dagster also provides a growing set of optional add-on libraries to integrate wi Includes implementations of run and event log storage built on Postgres. + + + Power BI ( + dagster-powerbi) + + + Provides an integration to represent a Power BI workspace as a graph of + assets. + + Prometheus ( diff --git a/docs/content/_navigation.json b/docs/content/_navigation.json index 0653bca3b7a19..cd5e71c8f9e3a 100644 --- a/docs/content/_navigation.json +++ b/docs/content/_navigation.json @@ -1532,6 +1532,10 @@ "title": "PostgreSQL (dagster-postgres)", "path": "/_apidocs/libraries/dagster-postgres" }, + { + "title": "Power BI (dagster-powerbi)", + "path": "/_apidocs/libraries/dagster-powerbi" + }, { "title": "Prometheus (dagster-prometheus)", "path": "/_apidocs/libraries/dagster-prometheus" diff --git a/docs/content/api/modules.json.gz b/docs/content/api/modules.json.gz index dbc21166df0e8..d9d87a92f5660 100644 Binary files a/docs/content/api/modules.json.gz and b/docs/content/api/modules.json.gz differ diff --git a/docs/content/api/searchindex.json.gz b/docs/content/api/searchindex.json.gz index 9d9765a94f4e0..d3e799db8bc0b 100644 Binary files a/docs/content/api/searchindex.json.gz and b/docs/content/api/searchindex.json.gz differ diff --git a/docs/content/api/sections.json.gz b/docs/content/api/sections.json.gz index 5d8d811aff96d..baa3bf6f0f02e 100644 Binary files a/docs/content/api/sections.json.gz and b/docs/content/api/sections.json.gz differ diff --git a/docs/next/public/objects.inv b/docs/next/public/objects.inv index 0b5514b7cca86..feacc91726748 100644 Binary files a/docs/next/public/objects.inv and b/docs/next/public/objects.inv differ diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index 8a74633f4b1e6..b7d0bf010e826 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -38,6 +38,7 @@ "../../python_modules/libraries/dagster-github", "../../python_modules/libraries/dagster-k8s", "../../python_modules/libraries/dagster-looker", + "../../python_modules/libraries/dagster-powerbi", "../../python_modules/libraries/dagster-managed-elements", "../../python_modules/libraries/dagster-mlflow", "../../python_modules/libraries/dagster-msteams", diff --git a/docs/sphinx/index.rst b/docs/sphinx/index.rst index 75d32595ab06e..8518e7ce91548 100644 --- a/docs/sphinx/index.rst +++ b/docs/sphinx/index.rst @@ -67,6 +67,7 @@ sections/api/apidocs/libraries/dagster-pipes sections/api/apidocs/libraries/dagster-polars sections/api/apidocs/libraries/dagster-postgres + sections/api/apidocs/libraries/dagster-powerbi sections/api/apidocs/libraries/dagster-prometheus sections/api/apidocs/libraries/dagster-pyspark sections/api/apidocs/libraries/dagster-shell diff --git a/docs/sphinx/sections/api/apidocs/libraries/dagster-powerbi.rst b/docs/sphinx/sections/api/apidocs/libraries/dagster-powerbi.rst new file mode 100644 index 0000000000000..af091d503a6c9 --- /dev/null +++ b/docs/sphinx/sections/api/apidocs/libraries/dagster-powerbi.rst @@ -0,0 +1,17 @@ +########################## +Power BI (dagster-powerbi) +########################## + +Dagster allows you to represent your Power BI workspace as assets, alongside other your other +technologies like dbt and Sling. This allows you to see how your Power BI assets are connected to +your other data assets, and how changes to other data assets might impact your Power BI project. + +.. currentmodule:: dagster_powerbi + + +Assets +====== + +.. autoclass:: DagsterPowerBITranslator + +.. autoclass:: PowerBIWorkspace diff --git a/docs/tox.ini b/docs/tox.ini index 68fcf161d2291..e74e8ee93c3a7 100644 --- a/docs/tox.ini +++ b/docs/tox.ini @@ -45,6 +45,7 @@ deps = -e ../python_modules/libraries/dagster-deltalake-polars -e ../python_modules/libraries/dagster-openai -e ../python_modules/libraries/dagster-looker + -e ../python_modules/libraries/dagster-powerbi commands = make --directory=sphinx clean diff --git a/python_modules/libraries/dagster-powerbi/dagster_powerbi/__init__.py b/python_modules/libraries/dagster-powerbi/dagster_powerbi/__init__.py index b54e4e1b15316..5f505f8fdc5d0 100644 --- a/python_modules/libraries/dagster-powerbi/dagster_powerbi/__init__.py +++ b/python_modules/libraries/dagster-powerbi/dagster_powerbi/__init__.py @@ -2,8 +2,6 @@ from dagster_powerbi.resource import PowerBIWorkspace as PowerBIWorkspace from dagster_powerbi.translator import DagsterPowerBITranslator as DagsterPowerBITranslator - -# Move back to version.py and edit setup.py once we are ready to publish. -__version__ = "1!0+dev" +from dagster_powerbi.version import __version__ DagsterLibraryRegistry.register("dagster-powerbi", __version__) diff --git a/python_modules/libraries/dagster-powerbi/dagster_powerbi/resource.py b/python_modules/libraries/dagster-powerbi/dagster_powerbi/resource.py index 307d903d7e725..1a6b32a7a3a24 100644 --- a/python_modules/libraries/dagster-powerbi/dagster_powerbi/resource.py +++ b/python_modules/libraries/dagster-powerbi/dagster_powerbi/resource.py @@ -7,6 +7,7 @@ _check as check, external_assets_from_specs, ) +from dagster._annotations import public from dagster._core.definitions.cacheable_assets import ( AssetsDefinitionCacheableData, CacheableAssetsDefinition, @@ -24,6 +25,7 @@ BASE_API_URL = "https://api.powerbi.com/v1.0/myorg/" +@public class PowerBIWorkspace(ConfigurableResource): """Represents a workspace in PowerBI and provides utilities to interact with the PowerBI API. @@ -125,6 +127,7 @@ def fetch_powerbi_workspace_data( dashboards + reports + semantic_models + list(data_sources_by_id.values()), ) + @public def build_assets( self, dagster_powerbi_translator: Type[DagsterPowerBITranslator] = DagsterPowerBITranslator, diff --git a/python_modules/libraries/dagster-powerbi/dagster_powerbi/translator.py b/python_modules/libraries/dagster-powerbi/dagster_powerbi/translator.py index 1c81b0c6a3ec4..078ea008eb5ab 100644 --- a/python_modules/libraries/dagster-powerbi/dagster_powerbi/translator.py +++ b/python_modules/libraries/dagster-powerbi/dagster_powerbi/translator.py @@ -4,6 +4,7 @@ from typing import Any, Dict, Mapping, Sequence from dagster import _check as check +from dagster._annotations import public from dagster._core.definitions.asset_key import AssetKey from dagster._core.definitions.asset_spec import AssetSpec from dagster._record import record @@ -97,6 +98,7 @@ def from_content_data( ) +@public class DagsterPowerBITranslator: """Translator class which converts raw response data from the PowerBI API into AssetSpecs. Subclass this class to implement custom logic for each type of PowerBI content. diff --git a/python_modules/libraries/dagster-powerbi/dagster_powerbi/version.py b/python_modules/libraries/dagster-powerbi/dagster_powerbi/version.py new file mode 100644 index 0000000000000..fe3fd8a8248b6 --- /dev/null +++ b/python_modules/libraries/dagster-powerbi/dagster_powerbi/version.py @@ -0,0 +1 @@ +__version__ = "1!0+dev" diff --git a/python_modules/libraries/dagster-powerbi/setup.py b/python_modules/libraries/dagster-powerbi/setup.py index dea63b2a2c1b2..1b46961551fda 100644 --- a/python_modules/libraries/dagster-powerbi/setup.py +++ b/python_modules/libraries/dagster-powerbi/setup.py @@ -1,14 +1,15 @@ +from pathlib import Path +from typing import Dict + from setuptools import find_packages, setup def get_version() -> str: - return "1!0+dev" - # Uncomment when ready to publish - # version: Dict[str, str] = {} - # with open(Path(__file__).parent / "dagster_powerbi/version.py", encoding="utf8") as fp: - # exec(fp.read(), version) + version: Dict[str, str] = {} + with open(Path(__file__).parent / "dagster_powerbi/version.py", encoding="utf8") as fp: + exec(fp.read(), version) - # return version["__version__"] + return version["__version__"] ver = get_version()