Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions elementary/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
from dateutil import tz
from google.auth.exceptions import DefaultCredentialsError

from elementary.clients.dbt.dbt_runner import DbtRunner
from elementary.exceptions.exceptions import InvalidArgumentsError
from elementary.monitor import dbt_project_utils
from elementary.utils.ordered_yaml import OrderedYaml


Expand Down Expand Up @@ -177,32 +175,18 @@ def has_gcs(self):
return self.gcs_bucket_name and self.has_gcloud

def validate_monitor(self):
self._validate_internal_dbt_project()
self._validate_timezone()
if not self.has_slack:
raise InvalidArgumentsError(
"Either a Slack token and a channel or a Slack webhook is required."
)

def validate_report(self):
self._validate_internal_dbt_project()

def validate_send_report(self):
self._validate_internal_dbt_project()
if not self.has_send_report_platform:
raise InvalidArgumentsError(
"You must provide a platform to upload the report to (Slack token / S3 / GCS)."
)

def _validate_internal_dbt_project(self):
dbt_runner = DbtRunner(
dbt_project_utils.PATH,
self.profiles_dir,
self.profile_target,
dbt_env_vars=self.dbt_env_vars,
)
dbt_runner.debug(quiet=True)

def _validate_timezone(self):
if self.timezone and not tz.gettz(self.timezone):
raise InvalidArgumentsError("An invalid timezone was provided.")
Expand Down
1 change: 0 additions & 1 deletion elementary/monitor/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ def report(
Command.REPORT, get_cli_properties(), ctx.command.name
)
try:
config.validate_report()
data_monitoring = DataMonitoringReport(
config=config,
tracking=anonymous_tracking,
Expand Down