Skip to content

Commit 541fee2

Browse files
jyejarecursoragent
andcommitted
fix: Address Devin AI review comments on PR #6202
- Forward set_baseline parameter in DQMJobManager.execute_job for compute jobs so user intent to mark a computation as baseline is no longer silently dropped. - Add "1=1" fallback when ts_filter is empty (both start_date and end_date are None) in BigQuery, PostgreSQL, and Snowflake monitoring compute to prevent invalid SQL generation. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 3664e38 commit 541fee2

4 files changed

Lines changed: 26 additions & 16 deletions

File tree

sdk/python/feast/infra/offline_stores/bigquery.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,13 +1101,16 @@ def _bq_compute_monitoring_metrics(
11011101
top_n: int = 10,
11021102
) -> List[Dict[str, Any]]:
11031103
from_expression = data_source.get_table_query_string()
1104-
ts_filter = get_timestamp_filter_sql(
1105-
start_date,
1106-
end_date,
1107-
timestamp_field,
1108-
date_partition_column=data_source.date_partition_column,
1109-
quote_fields=False,
1110-
cast_style="timestamp_func",
1104+
ts_filter = (
1105+
get_timestamp_filter_sql(
1106+
start_date,
1107+
end_date,
1108+
timestamp_field,
1109+
date_partition_column=data_source.date_partition_column,
1110+
quote_fields=False,
1111+
cast_style="timestamp_func",
1112+
)
1113+
or "1=1"
11111114
)
11121115
numeric_features = [n for n, t in feature_columns if t == "numeric"]
11131116
categorical_features = [n for n, t in feature_columns if t == "categorical"]

sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,16 @@ def compute_monitoring_metrics(
315315
assert isinstance(data_source, PostgreSQLSource)
316316

317317
from_expression = data_source.get_table_query_string()
318-
ts_filter = get_timestamp_filter_sql(
319-
start_date,
320-
end_date,
321-
timestamp_field,
322-
tz=timezone.utc,
323-
cast_style="timestamptz",
324-
date_time_separator=" ",
318+
ts_filter = (
319+
get_timestamp_filter_sql(
320+
start_date,
321+
end_date,
322+
timestamp_field,
323+
tz=timezone.utc,
324+
cast_style="timestamptz",
325+
date_time_separator=" ",
326+
)
327+
or "1=1"
325328
)
326329

327330
numeric_features = [n for n, t in feature_columns if t == "numeric"]

sdk/python/feast/infra/offline_stores/snowflake.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,11 @@ def compute_monitoring_metrics(
451451
from_expression = _qualify_snowflake_from_expression(
452452
config, data_source, from_expression
453453
)
454-
ts_filter = get_timestamp_filter_sql(
455-
start_date, end_date, timestamp_field, tz=timezone.utc
454+
ts_filter = (
455+
get_timestamp_filter_sql(
456+
start_date, end_date, timestamp_field, tz=timezone.utc
457+
)
458+
or "1=1"
456459
)
457460

458461
numeric_features = [n for n, t in feature_columns if t == "numeric"]

sdk/python/feast/monitoring/dqm_job_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def execute_job(self, job_id: str, monitoring_service) -> Dict[str, Any]:
136136
if params.get("end_date")
137137
else None,
138138
granularity=params.get("granularity", "daily"),
139+
set_baseline=params.get("set_baseline", False),
139140
)
140141
else:
141142
raise ValueError(f"Unknown job type '{job_type}'")

0 commit comments

Comments
 (0)