Skip to content

Commit 294217b

Browse files
committed
Added suggested changes
1 parent c379179 commit 294217b

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

tap_frontapp/discover.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _check_stream_access(client, stream_name):
2727
return True
2828
except FrontappForbiddenError as exc:
2929
LOGGER.warning(
30-
"Stream '%s' does not have read permission, excluding from catalog. Detail: %s",
30+
"Unauthorized Stream: %s, excluding from catalog. HTTP-Error-Message:'%s'",
3131
stream_name,
3232
str(exc),
3333
)
@@ -55,12 +55,12 @@ def _apply_access_checks(client, schemas: dict, field_metadata: dict) -> None:
5555

5656
if not schemas:
5757
raise FrontappForbiddenError(
58-
"HTTP-error-code: 403, Error: Credentials lack read access to all supported streams."
58+
"No streams are accessible. Ensure the credentials have read permission for at least one stream."
5959
)
6060

6161
if inaccessible_streams:
6262
LOGGER.warning(
63-
"These streams have been excluded due to 403 Forbidden: %s",
63+
"These streams have been excluded due to HTTP-Error-Code:403 Forbidden: %s",
6464
", ".join(inaccessible_streams),
6565
)
6666

tap_frontapp/streams.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def sync_metric(atx, metric_name, start_date, end_date, mdata=None):
184184
"analytics_range": 'daily',
185185
"metric_id": metric_id,
186186
"metric_description": metric_description,
187+
**{metric_key: None for metric_key in FRONT_REPORT_API_AVAILABLE_METRICS},
187188
**{report_metric["id"]: report_metric["value"] for report_metric in report_metrics}
188189
}
189190

@@ -214,7 +215,7 @@ def sync_metrics(atx, metric_name, mdata=None):
214215
# start_date is defaulted in the config file 2018-01-01
215216
# if there's no default date and it gets set to now, then start_date will have to be
216217
# set to the prior business day before we can use it.
217-
now = datetime.datetime.now()
218+
now = datetime.datetime.now(datetime.timezone.utc)
218219
s_d = now.replace(hour=0, minute=0, second=0, microsecond=0)
219220
default_start = (s_d + datetime.timedelta(days=-1, hours=0)).strftime("%Y-%m-%d %H:%M:%S")
220221
start_date = pendulum.parse(atx.config.get('start_date', default_start))

0 commit comments

Comments
 (0)