Skip to content

Commit

Permalink
HA-418 - Added frequency field to DataHubSchema integration config (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
andres-torres-marroquin authored Jan 30, 2025
1 parent 7ae901f commit c0839fc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Changes can also be flagged with a GitHub label for tracking purposes. The URL o

## [Unreleased](https://github.com/ethyca/fides/compare/2.54.0...main)


## Changed
- Added frequency field to DataHubSchema integration config [#5716](https://github.com/ethyca/fides/pull/5716)

## [2.53.0](https://github.com/ethyca/fides/compare/2.53.0...2.54.0)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from enum import Enum
from typing import ClassVar, List

from pydantic import Field
Expand All @@ -9,6 +10,14 @@
)


class PeriodicIntegrationFrequency(Enum):
"""Enum for periodic integration frequency"""

daily = "daily"
weekly = "weekly"
monthly = "monthly"


class DatahubSchema(ConnectionConfigSecretsSchema):
datahub_server_url: AnyHttpUrlStringRemovesSlash = Field(
title="DataHub Server URL",
Expand All @@ -19,6 +28,11 @@ class DatahubSchema(ConnectionConfigSecretsSchema):
description="The token used to authenticate with your DataHub server.",
json_schema_extra={"sensitive": True},
)
frequency: PeriodicIntegrationFrequency = Field(
title="Frequency",
description="The frequency at which the integration should run. Defaults to daily.",
default=PeriodicIntegrationFrequency.daily,
)

_required_components: ClassVar[List[str]] = ["datahub_server_url", "datahub_token"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,7 @@ def test_put_datahub_connection_config_secrets(
payload = {
"datahub_server_url": "https://datahub.example.com",
"datahub_token": "test",
"frequency": "weekly",
}
resp = api_client.put(
url + "?verify=False",
Expand All @@ -2034,6 +2035,7 @@ def test_put_datahub_connection_config_secrets(
assert datahub_connection_config_no_secrets.secrets == {
"datahub_server_url": "https://datahub.example.com",
"datahub_token": "test",
"frequency": "weekly",
}
assert datahub_connection_config_no_secrets.last_test_timestamp is None
assert datahub_connection_config_no_secrets.last_test_succeeded is None
Expand Down Expand Up @@ -2069,6 +2071,7 @@ def test_put_datahub_connection_config_secrets_default_frequency(
assert datahub_connection_config_no_secrets.secrets == {
"datahub_server_url": "https://datahub.example.com",
"datahub_token": "test",
"frequency": "daily",
}
assert datahub_connection_config_no_secrets.last_test_timestamp is None
assert datahub_connection_config_no_secrets.last_test_succeeded is None
Expand All @@ -2085,7 +2088,7 @@ def test_put_datahub_connection_config_secrets_missing_url(
"""
url = f"{V1_URL_PREFIX}{CONNECTIONS}/{datahub_connection_config_no_secrets.key}/secret"
auth_header = generate_auth_header(scopes=[CONNECTION_CREATE_OR_UPDATE])
payload = {"datahub_token": "test"}
payload = {"datahub_token": "test", "frequency": "weekly"}
resp = api_client.put(
url + "?verify=False",
headers=auth_header,
Expand All @@ -2111,6 +2114,7 @@ def test_put_datahub_connection_config_secrets_missing_token(
auth_header = generate_auth_header(scopes=[CONNECTION_CREATE_OR_UPDATE])
payload = {
"datahub_server_url": "https://datahub.example.com",
"frequency": "weekly",
}
resp = api_client.put(
url + "?verify=False",
Expand Down

0 comments on commit c0839fc

Please sign in to comment.