Skip to content

Commit

Permalink
chore: fix name
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperHG90 committed Mar 18, 2024
1 parent d6651bd commit 9110f66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import os

from dagster import define_asset_job, multiprocess_executor
from dagster_utils.factories.hooks import gcp_metric_hook_factory
from dagster_utils.factories.hooks import gcp_metric_job_success_hook_factory
from luchtmeetnet_ingestion.assets import air_quality_data, daily_air_quality_data
from luchtmeetnet_ingestion.partitions import daily_partition, daily_station_partition

environment = os.getenv("ENVIRONMENT", "dev")


gcp_metric_on_success = gcp_metric_hook_factory(
gcp_metric_on_success = gcp_metric_job_success_hook_factory(
name="gcp_metric_on_success",
description="GCP metric hook for success",
on_success=True,
gcp_resource_name="gcp_metrics",
)


gcp_metric_on_failure = gcp_metric_hook_factory(
gcp_metric_on_failure = gcp_metric_job_success_hook_factory(
name="gcp_metric_on_failure",
description="GCP metric hook for failure",
on_success=False,
Expand Down
6 changes: 3 additions & 3 deletions shared/dagster_utils/src/dagster_utils/factories/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
from dagster_utils.factories.base import DagsterObjectFactory


def gcp_metric_hook_factory(
def gcp_metric_job_success_hook_factory(
name: str, description: str, on_success: bool, gcp_resource_name: typing.Optional[str] = None
) -> typing.Callable:
return GcpMetricHookFactory(
return GcpMetricJobSuccessHookFactory(
name=name,
description=description,
on_success=on_success,
gcp_resource_name=gcp_resource_name,
)()


class GcpMetricHookFactory(DagsterObjectFactory):
class GcpMetricJobSuccessHookFactory(DagsterObjectFactory):
def __init__(
self,
name: str,
Expand Down

0 comments on commit 9110f66

Please sign in to comment.